This repository was archived by the owner on Aug 30, 2024. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork18
Error coder sh commands if the env requires a rebuild#163
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
4 commits Select commitHold shift + click to select a range
94cca55
Error coder sh commands if the env requires a rebuild
cmoog2b79284
fixup! Error coder sh commands if the env requires a rebuild
cmoogd0adddc
fixup! Error coder sh commands if the env requires a rebuild
cmoog04e36f8
fixup! Error coder sh commands if the env requires a rebuild
cmoogFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
4 changes: 0 additions & 4 deletionscoder-sdk/env.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionsdocs/coder_sh.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
66 changes: 34 additions & 32 deletionsinternal/cmd/cmd.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -21,24 +21,24 @@ func Make() *cobra.Command { | ||
} | ||
app.AddCommand( | ||
loginCmd(), | ||
logoutCmd(), | ||
shCmd(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Why the rename of this particular command? Consistency seems better here, so we should change them all or not change this one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Yeah fair point. Just updated all uses of | ||
usersCmd(), | ||
configSSHCmd(), | ||
secretsCmd(), | ||
envsCmd(), | ||
syncCmd(), | ||
urlCmd(), | ||
resourceCmd(), | ||
completionCmd(), | ||
genDocsCmd(app), | ||
) | ||
app.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "show verbose output") | ||
return app | ||
} | ||
funcgenDocsCmd(rootCmd *cobra.Command) *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "gen-docs [dir_path]", | ||
Short: "Generate a markdown documentation tree for the root command.", | ||
@@ -52,17 +52,18 @@ func genDocs(rootCmd *cobra.Command) *cobra.Command { | ||
} | ||
// reference: https://github.com/spf13/cobra/blob/master/shell_completions.md | ||
func completionCmd() *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "completion [bash|zsh|fish|powershell]", | ||
Short: "Generate completion script", | ||
Example: `coder completion fish > ~/.config/fish/completions/coder.fish | ||
coder completion zsh > "${fpath[1]}/_coder" | ||
Linux: | ||
$ coder completion bash > /etc/bash_completion.d/coder | ||
MacOS: | ||
$ coder completion bash > /usr/local/etc/bash_completion.d/coder`, | ||
Long: `To load completions: | ||
Bash: | ||
@@ -93,19 +94,20 @@ $ coder completion fish | source | ||
To load completions for each session, execute once: | ||
$ coder completion fish > ~/.config/fish/completions/coder.fish | ||
`, | ||
DisableFlagsInUseLine: true, | ||
ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, | ||
Args: cobra.ExactValidArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
switch args[0] { | ||
case "bash": | ||
_ = cmd.Root().GenBashCompletion(os.Stdout) // Best effort. | ||
case "zsh": | ||
_ = cmd.Root().GenZshCompletion(os.Stdout) // Best effort. | ||
case "fish": | ||
_ = cmd.Root().GenFishCompletion(os.Stdout, true) // Best effort. | ||
case "powershell": | ||
_ = cmd.Root().GenPowerShellCompletion(os.Stdout) // Best effort. | ||
} | ||
}, | ||
} | ||
} |
2 changes: 1 addition & 1 deletioninternal/cmd/configssh.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -18,7 +18,7 @@ import ( | ||
"golang.org/x/xerrors" | ||
) | ||
funcconfigSSHCmd() *cobra.Command { | ||
var ( | ||
configpath string | ||
remove = false | ||
18 changes: 9 additions & 9 deletionsinternal/cmd/envs.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/cmd/login.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/cmd/logout.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletionsinternal/cmd/secrets.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
25 changes: 19 additions & 6 deletionsinternal/cmd/shell.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/cmd/sync.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletionsinternal/cmd/urls.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletioninternal/cmd/users.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.