From cf9699bbbbbdc3d041587f513bf0f7fa2d4107ff Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Sat, 6 Apr 2024 12:46:05 +0100 Subject: [PATCH] Add `--skip-ssh-key` to options Signed-off-by: Babak K. Shandiz --- pkg/cmd/auth/login/login.go | 41 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/pkg/cmd/auth/login/login.go b/pkg/cmd/auth/login/login.go index 34a345632..cfc7c2a3a 100644 --- a/pkg/cmd/auth/login/login.go +++ b/pkg/cmd/auth/login/login.go @@ -30,12 +30,13 @@ type LoginOptions struct { Interactive bool - Hostname string - Scopes []string - Token string - Web bool - GitProtocol string - InsecureStorage bool + Hostname string + Scopes []string + Token string + Web bool + GitProtocol string + InsecureStorage bool + SkipSSHKeyPrompt bool } func NewCmdLogin(f *cmdutil.Factory, runF func(*LoginOptions) error) *cobra.Command { @@ -138,6 +139,7 @@ func NewCmdLogin(f *cmdutil.Factory, runF func(*LoginOptions) error) *cobra.Comm _ = cmd.Flags().MarkHidden("secure-storage") cmd.Flags().BoolVar(&opts.InsecureStorage, "insecure-storage", false, "Save authentication credentials in plain text instead of credential store") + cmd.Flags().BoolVar(&opts.SkipSSHKeyPrompt, "skip-ssh-key", false, "Skip generate/upload SSH key prompt") return cmd } @@ -189,19 +191,20 @@ func loginRun(opts *LoginOptions) error { } return shared.Login(&shared.LoginOptions{ - IO: opts.IO, - Config: authCfg, - HTTPClient: httpClient, - Hostname: hostname, - Interactive: opts.Interactive, - Web: opts.Web, - Scopes: opts.Scopes, - Executable: opts.MainExecutable, - GitProtocol: opts.GitProtocol, - Prompter: opts.Prompter, - GitClient: opts.GitClient, - Browser: opts.Browser, - SecureStorage: !opts.InsecureStorage, + IO: opts.IO, + Config: authCfg, + HTTPClient: httpClient, + Hostname: hostname, + Interactive: opts.Interactive, + Web: opts.Web, + Scopes: opts.Scopes, + Executable: opts.MainExecutable, + GitProtocol: opts.GitProtocol, + Prompter: opts.Prompter, + GitClient: opts.GitClient, + Browser: opts.Browser, + SecureStorage: !opts.InsecureStorage, + SkipSSHKeyPrompt: opts.SkipSSHKeyPrompt, }) }