MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / PromptForSshAccount

Function PromptForSshAccount

pkg/machinescommon/ssh_common.go:146–170  ·  view source on GitHub ↗
(opts *SshCommonOptions, flags *SshCommonFlags)

Source from the content-addressed store, hash-verified

144}
145
146func PromptForSshAccount(opts *SshCommonOptions, flags *SshCommonFlags) error {
147 var account accounts.IAccount
148 if flags.Account.Value == "" {
149 selectedAccount, err := selectors.Select(
150 opts.Ask,
151 "Select the account to use\n",
152 opts.GetAllAccountsForSshMachine,
153 func(a accounts.IAccount) string {
154 return a.GetName()
155 })
156 if err != nil {
157 return err
158 }
159 account = selectedAccount
160 } else {
161 a, err := GetSshAccount(opts, flags)
162 if err != nil {
163 return err
164 }
165 account = a
166 }
167
168 flags.Account.Value = account.GetName()
169 return nil
170}
171
172func getTargetRuntimeOptions() []*selectors.SelectOption[string] {
173 return []*selectors.SelectOption[string]{

Callers 3

PromptMissingFunction · 0.92

Calls 3

SelectFunction · 0.92
GetSshAccountFunction · 0.85
GetNameMethod · 0.65

Tested by 2