- Notifications
You must be signed in to change notification settings - Fork905
feat: add one shot commands to the coder ssh command#17779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
func(next serpent.HandlerFunc) serpent.HandlerFunc { | ||
return func(i *serpent.Invocation) error { | ||
got := len(i.Args) | ||
if got < 1 { | ||
return xerrors.New("expected the name of a workspace") | ||
} | ||
return next(i) | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Keep this here, but we should add a serpent MW forRequireMinArgs(n)
. I also wanted it at some point.
cli/ssh.go Outdated
Use: "ssh <workspace>", | ||
Short: "Start a shell into a workspace", | ||
Use: "ssh <workspace> [command]", | ||
Short: "Start a shell into a workspace or run a command", | ||
Long: "This command does not have full parity with the standard SSH command. For users who need the full functionality of SSH, create an ssh configuration with `coder config-ssh`.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ssh <workspace> ls -la
works, butcoder ssh <workspace> ls -la
does not. I don't think we have to fix this, but we should have an example on how to pass flags. It is common unix stuff, but worth throwing in here imo.
Long:"This command does not have full parity with the standard SSH command. For users who need the full functionality of SSH, create an ssh configuration with `coder config-ssh`.", | |
Long:"This command does not have full parity with the standard SSH command. For users who need the full functionality of SSH, create an ssh configuration with `coder config-ssh`.\n"+ | |
FormatExamples( | |
Example{ | |
Description:"Use `--` to separate and pass flags directly to the command executed via SSH.", | |
Command:"coder ssh <workspace> -- ls -la", | |
}, | |
), |
2cd3f99
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Closes#2154
Warning
The tests in this PR were co-authored by AI