File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 9898 if flagPort , err := cmd .PersistentFlags ().GetString ("port" ); err == nil {
9999 port = flagPort
100100 }
101- if flagIdentity , err := cmd .PersistentFlags ().GetString ("identity" ); err == nil {
101+ if flagIdentity , err := cmd .PersistentFlags ().GetString ("identity" ); err == nil && flagIdentity != "" {
102102 privateFile = flagIdentity
103103 }
104- if flagPassword , err := cmd .PersistentFlags ().GetString ("password" ); err == nil {
104+ if flagPassword , err := cmd .PersistentFlags ().GetString ("password" ); err == nil && flagPassword != "" {
105105 password = flagPassword
106106 auths = append (auths , gossh .Password (password ))
107107 }
110110 defaultConfig := ssh.Config {}
111111 defaultConfig .SetDefaults ()
112112
113- if flagConfig , err := cmd .PersistentFlags ().GetString ("config" ); err == nil {
113+ if flagConfig , err := cmd .PersistentFlags ().GetString ("config" ); err == nil && flagConfig != "" {
114114 raw , err := os .ReadFile (flagConfig )
115115 if err != nil {
116116 log .Fatal (err )
156156
157157 auths = append (auths , gossh .PublicKeys (signer ))
158158 }
159-
160159 config := & gossh.ClientConfig {
161160 User : username ,
162161 Auth : auths ,
You can’t perform that action at this time.
0 commit comments