Skip to content

Commit

Permalink
Improve command line help
Browse files Browse the repository at this point in the history
  • Loading branch information
aacebedo committed Oct 8, 2024
1 parent 4513077 commit 0a05b2f
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewBuildCmd(flags *flags.GlobalFlags) *cobra.Command {
GlobalFlags: flags,
}
buildCmd := &cobra.Command{
Use: "build",
Use: "build [flags] [workspace-path|workspace-name]",
Short: "Builds a workspace",
RunE: func(_ *cobra.Command, args []string) error {
ctx := context.Background()
Expand Down
2 changes: 1 addition & 1 deletion cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewDeleteCmd(flags *flags.GlobalFlags) *cobra.Command {
GlobalFlags: flags,
}
deleteCmd := &cobra.Command{
Use: "delete",
Use: "delete [flags] [workspace-path|workspace-name]",
Short: "Deletes an existing workspace",
RunE: func(_ *cobra.Command, args []string) error {
_, err := clientimplementation.DecodeOptionsFromEnv(clientimplementation.DevPodFlagsDelete, &cmd.DeleteOptions)
Expand Down
2 changes: 1 addition & 1 deletion cmd/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NewExportCmd(flags *flags.GlobalFlags) *cobra.Command {
GlobalFlags: flags,
}
exportCmd := &cobra.Command{
Use: "export",
Use: "export [flags] [workspace-path|workspace-name]",
Short: "Exports a workspace configuration",
RunE: func(_ *cobra.Command, args []string) error {
ctx := context.Background()
Expand Down
7 changes: 5 additions & 2 deletions cmd/ide/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ func NewUseCmd(flags *flags.GlobalFlags) *cobra.Command {
}
useCmd := &cobra.Command{
Use: "use",
Short: "Configure the default IDE to use",
Short: "Configure the default IDE to use (list available IDEs with 'devpod ide list')",
Long: `Configure the default IDE to use
Available IDEs can be listed with 'devpod ide list'`,
RunE: func(_ *cobra.Command, args []string) error {
if len(args) != 1 {
return fmt.Errorf("please specify the ide to use")
return fmt.Errorf("please specify the ide to use, list available IDEs with 'devpod ide list'")
}

return cmd.Run(context.Background(), args[0])
Expand Down
2 changes: 1 addition & 1 deletion cmd/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewLogsCmd(flags *flags.GlobalFlags) *cobra.Command {
GlobalFlags: flags,
}
startCmd := &cobra.Command{
Use: "logs",
Use: "logs [flags] [workspace-path|workspace-name]",
Short: "Prints the workspace logs on the machine",
RunE: func(_ *cobra.Command, args []string) error {
return cmd.Run(context.Background(), args)
Expand Down
2 changes: 1 addition & 1 deletion cmd/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func NewSSHCmd(f *flags.GlobalFlags) *cobra.Command {
GlobalFlags: f,
}
sshCmd := &cobra.Command{
Use: "ssh",
Use: "ssh [flags] [workspace-folder|workspace-name]",
Short: "Starts a new ssh session to a workspace",
RunE: func(_ *cobra.Command, args []string) error {
devPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)
Expand Down
2 changes: 1 addition & 1 deletion cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewStatusCmd(flags *flags.GlobalFlags) *cobra.Command {
GlobalFlags: flags,
}
statusCmd := &cobra.Command{
Use: "status",
Use: "status [flags] [workspace-path|workspace-name]",
Short: "Shows the status of a workspace",
RunE: func(_ *cobra.Command, args []string) error {
_, err := clientimplementation.DecodeOptionsFromEnv(clientimplementation.DevPodFlagsStatus, &cmd.StatusOptions)
Expand Down
2 changes: 1 addition & 1 deletion cmd/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NewStopCmd(flags *flags.GlobalFlags) *cobra.Command {
GlobalFlags: flags,
}
stopCmd := &cobra.Command{
Use: "stop",
Use: "stop [flags] [workspace-path|workspace-name]",
Aliases: []string{"down"},
Short: "Stops an existing workspace",
RunE: func(_ *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewUpCmd(f *flags.GlobalFlags) *cobra.Command {
GlobalFlags: f,
}
upCmd := &cobra.Command{
Use: "up",
Use: "up [flags] [workspace-path|workspace-name]",
Short: "Starts a new workspace",
RunE: func(_ *cobra.Command, args []string) error {
devPodConfig, err := config.LoadConfig(cmd.Context, cmd.Provider)
Expand Down

0 comments on commit 0a05b2f

Please sign in to comment.