From 7d497326c4ee39b94d312059cc80b0bd03f74967 Mon Sep 17 00:00:00 2001 From: Manuel Dewald Date: Thu, 5 Jun 2025 11:31:58 +0200 Subject: [PATCH] docs(usage): Consistent formatting of short descriptions --- cli/cmd/exec.go | 4 ++-- cli/cmd/list-teams.go | 4 ++-- cli/cmd/list-workspaces.go | 4 ++-- cli/cmd/list.go | 4 ++-- cli/cmd/log.go | 2 +- cli/cmd/open-workspace.go | 4 ++-- cli/cmd/open.go | 4 ++-- cli/cmd/root.go | 2 +- cli/cmd/set-env-vars.go | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cli/cmd/exec.go b/cli/cmd/exec.go index bf404ed..17a53f4 100644 --- a/cli/cmd/exec.go +++ b/cli/cmd/exec.go @@ -44,8 +44,8 @@ func AddExecCmd(rootCmd *cobra.Command, opts GlobalOptions) { Use: "exec", Args: cobra.MinimumNArgs(1), Short: "Run a command in Codesphere workspace", - Long: `Run a command in a Codesphere workspace. - Output will be printed to STDOUT, errors to STDERR.`, + Long: out.Long(`Run a command in a Codesphere workspace. + Output will be printed to STDOUT, errors to STDERR.`), Example: out.FormatExampleCommands("exec", []out.Example{ {Cmd: "-- echo hello world", Desc: "Print `hello world`"}, {Cmd: "-- find .", Desc: "List all files in workspace"}, diff --git a/cli/cmd/list-teams.go b/cli/cmd/list-teams.go index 827e896..036e83c 100644 --- a/cli/cmd/list-teams.go +++ b/cli/cmd/list-teams.go @@ -22,8 +22,8 @@ func addListTeamsCmd(p *cobra.Command, opts GlobalOptions) { l := ListTeamsCmd{ cmd: &cobra.Command{ Use: "teams", - Short: "list teams", - Long: `list teams available in Codesphere`, + Short: "List teams", + Long: `List teams available in Codesphere`, Example: out.FormatExampleCommands("list teams", []out.Example{ {Desc: "List all teams"}, }), diff --git a/cli/cmd/list-workspaces.go b/cli/cmd/list-workspaces.go index a44e9ae..ed8d085 100644 --- a/cli/cmd/list-workspaces.go +++ b/cli/cmd/list-workspaces.go @@ -22,8 +22,8 @@ func addListWorkspacesCmd(p *cobra.Command, opts GlobalOptions) { l := ListWorkspacesCmd{ cmd: &cobra.Command{ Use: "workspaces", - Short: "list workspaces", - Long: `list workspaces available in Codesphere`, + Short: "List workspaces", + Long: `List workspaces available in Codesphere`, Example: out.FormatExampleCommands("list workspaces", []out.Example{ {Cmd: "--team-id ", Desc: "List all workspaces"}, }), diff --git a/cli/cmd/list.go b/cli/cmd/list.go index 91644fc..27def86 100644 --- a/cli/cmd/list.go +++ b/cli/cmd/list.go @@ -16,8 +16,8 @@ func AddListCmd(rootCmd *cobra.Command, opts GlobalOptions) { l := ListCmd{ cmd: &cobra.Command{ Use: "list", - Short: "list resources", - Long: `list resources available in Codesphere`, + Short: "List resources", + Long: `List resources available in Codesphere`, Example: out.FormatExampleCommands("list", []out.Example{ {Cmd: "workspaces", Desc: "List all workspaces"}, }), diff --git a/cli/cmd/log.go b/cli/cmd/log.go index 595806a..aca4801 100644 --- a/cli/cmd/log.go +++ b/cli/cmd/log.go @@ -57,7 +57,7 @@ func AddLogCmd(rootCmd *cobra.Command, opts GlobalOptions) { logCmd := LogCmd{ cmd: &cobra.Command{ Use: "log", - Short: "Retrieve Run logs from services", + Short: "Retrieve run logs from services", Long: `You can retrieve logs based on the given scope. If you provide the step number and server, it returns all logs from diff --git a/cli/cmd/open-workspace.go b/cli/cmd/open-workspace.go index 8a79690..1dcfb06 100644 --- a/cli/cmd/open-workspace.go +++ b/cli/cmd/open-workspace.go @@ -39,8 +39,8 @@ func AddOpenWorkspaceCmd(open *cobra.Command, opts GlobalOptions) { workspace := OpenWorkspaceCmd{ cmd: &cobra.Command{ Use: "workspace", - Short: "Open workspace in web browser", - Long: `Open workspace in the Codesphere IDE.`, + Short: "Open workspace in the Codesphere IDE", + Long: `Open workspace in the Codesphere IDE in your web browser.`, Example: out.FormatExampleCommands("open workspace", []out.Example{ {Cmd: "-w 42", Desc: "open workspace 42 in web browser"}, {Cmd: "", Desc: "open workspace set by environment variable CS_WORKSPACE_ID"}, diff --git a/cli/cmd/open.go b/cli/cmd/open.go index 9163289..aca84b7 100644 --- a/cli/cmd/open.go +++ b/cli/cmd/open.go @@ -27,8 +27,8 @@ func AddOpenCmd(rootCmd *cobra.Command, opts GlobalOptions) { open := OpenCmd{ cmd: &cobra.Command{ Use: "open", - Short: "Open the codesphere IDE", - Long: `Open the codesphere IDE.`, + Short: "Open the Codesphere IDE", + Long: `Open the Codesphere IDE.`, }, } rootCmd.AddCommand(open.cmd) diff --git a/cli/cmd/root.go b/cli/cmd/root.go index dc7b72f..11d0fb7 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -63,7 +63,7 @@ func (o GlobalOptions) GetWorkspaceId() (int, error) { func GetRootCmd() *cobra.Command { var rootCmd = &cobra.Command{ Use: "cs", - Short: "The codesphere CLI", + Short: "The Codesphere CLI", Long: `Manage and debug resources deployed in Codesphere via command line.`, } diff --git a/cli/cmd/set-env-vars.go b/cli/cmd/set-env-vars.go index 5235a96..f86aeef 100644 --- a/cli/cmd/set-env-vars.go +++ b/cli/cmd/set-env-vars.go @@ -25,8 +25,8 @@ func AddSetEnvVarCmd(p *cobra.Command, opts GlobalOptions) { l := SetEnvVarCmd{ cmd: &cobra.Command{ Use: "set-env", - Short: "set env vars", - Long: `set environment variables for your workspace`, + Short: "Set environment varariables", + Long: `Set environment variables in a workspace`, Example: out.FormatExampleCommands("set-env", []out.Example{ {Cmd: "--workspace --env-var foo=bar", Desc: "Set single environment variable"}, {Cmd: "--workspace --env-var foo=bar --env-var hello=world", Desc: "Set multiple environment variables"},