Skip to content

Commit 4f1043c

Browse files
authored
Improve help section layout (#2539)
1 parent 3f830ed commit 4f1043c

File tree

6 files changed

+34
-36
lines changed

6 files changed

+34
-36
lines changed

artifactory/cli.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,6 @@ func GetCommands() []cli.Command {
640640
Name: "go",
641641
Hidden: true,
642642
Flags: cliutils.GetCommandFlags(cliutils.Go),
643-
Aliases: []string{"go"},
644643
Usage: gocommand.GetDescription(),
645644
HelpName: corecommon.CreateUsage("rt go", gocommand.GetDescription(), gocommand.Usage),
646645
UsageText: gocommand.GetArguments(),

buildtools/cli.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ func GetCommands() []cli.Command {
208208
{
209209
Name: "go",
210210
Flags: cliutils.GetCommandFlags(cliutils.Go),
211-
Aliases: []string{"go"},
212211
Usage: gocommand.GetDescription(),
213212
HelpName: corecommon.CreateUsage("go", gocommand.GetDescription(), gocommand.Usage),
214213
UsageText: gocommand.GetArguments(),

docs/artifactory/buildaddgit/help.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package buildaddgit
33
var Usage = []string{"rt bag [command options] <build name> <build number> [Path To .git]"}
44

55
func GetDescription() string {
6-
return "Collects the Git revision and URL from the local .git directory and adds it to the build-info.\n" +
7-
"It can also collect the list of tracked project issues (for example, issues stored in JIRA or other bug tracking systems) and add them to the build-info.\n" +
8-
"The issues are collected by reading the git commit messages from the local git log.\n" +
9-
"Each commit message is matched against a pre-configured regular expression, which retrieves the issue ID and issue summary.\n" +
10-
"The information required for collecting the issues is retrieved from a yaml configuration file provided to the command."
6+
return `Collects the Git revision and URL from the local .git directory and adds it to the build-info.
7+
It can also collect the list of tracked project issues (for example, issues stored in JIRA or other bug tracking systems) and add them to the build-info.
8+
The issues are collected by reading the git commit messages from the local git log.
9+
Each commit message is matched against a pre-configured regular expression, which retrieves the issue ID and issue summary.
10+
The information required for collecting the issues is retrieved from a yaml configuration file provided to the command.`
1111
}
1212

1313
func GetArguments() string {

docs/artifactory/transferconfig/help.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package transferconfig
33
var Usage = []string{"rt transfer-config [command options] <source-server-id> <target-server-id>"}
44

55
func GetDescription() string {
6-
return "Copy full Artifactory configuration from source Artifactory server to target Artifactory server. Warning - This action will wipe all Artifactory content in this target server."
6+
return `Copy full Artifactory configuration from source Artifactory server to target Artifactory server.
7+
Warning - This action will wipe all Artifactory content in this target server.`
78
}
89

910
func GetArguments() string {

docs/general/token/help.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ package token
33
var Usage = []string{"atc", "atc <username>"}
44

55
func GetDescription() string {
6-
return `Creates an access token.
7-
By default, an user-scoped token will be created.
8-
Administrator may provide the scope explicitly with '--scope', or implicitly with '--groups', '--grant-admin'.`
6+
return `Creates an access token. By default, an user-scoped token will be created.
7+
Administrator may provide the scope explicitly with '--scope', or implicitly with '--groups', '--grant-admin'.`
98
}
109

1110
func GetArguments() string {

main.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ const subcommandHelpTemplate = `NAME:
6464
{{.HelpName}} - {{.Usage}}
6565
6666
USAGE:
67-
{{if .Usage}}{{.Usage}}{{ "\n\t" }}{{end}}{{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} [arguments...]
67+
{{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} [arguments...]
6868
6969
COMMANDS:
70-
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
70+
{{range .VisibleCommands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
7171
{{end}}{{if .VisibleFlags}}{{if .ArgsUsage}}
7272
Arguments:
7373
{{.ArgsUsage}}{{ "\n" }}{{end}}
@@ -94,7 +94,7 @@ func execMain() error {
9494

9595
app := cli.NewApp()
9696
app.Name = jfrogAppName
97-
app.Usage = "See https://github.com/jfrog/jfrog-cli for usage instructions."
97+
app.Usage = "See https://docs.jfrog-applications.jfrog.io/jfrog-applications/jfrog-cli for full documentation."
9898
app.Version = cliutils.GetVersion()
9999
args := os.Args
100100
cliutils.SetCliExecutableName(args[0])
@@ -110,7 +110,7 @@ func execMain() error {
110110
cli.AppHelpTemplate = getAppHelpTemplate()
111111
cli.SubcommandHelpTemplate = subcommandHelpTemplate
112112
app.CommandNotFound = func(c *cli.Context, command string) {
113-
_, err := fmt.Fprintf(c.App.Writer, "'"+c.App.Name+" "+command+"' is not a jf command. See --help\n")
113+
_, err = fmt.Fprintf(c.App.Writer, "'"+c.App.Name+" "+command+"' is not a jf command. See --help\n")
114114
if err != nil {
115115
clientlog.Debug(err)
116116
os.Exit(1)
@@ -209,32 +209,33 @@ func searchSimilarCmds(cmds []cli.Command, toCompare string) (bestSimilarity []s
209209
}
210210

211211
const otherCategory = "Other"
212+
const commandNamespacesCategory = "Command Namespaces"
212213

213214
func getCommands() ([]cli.Command, error) {
214215
cliNameSpaces := []cli.Command{
215216
{
216217
Name: cliutils.CmdArtifactory,
217-
Usage: "JFrog Artifactory commands.",
218+
Usage: "Artifactory commands.",
218219
Subcommands: artifactory.GetCommands(),
219-
Category: otherCategory,
220+
Category: commandNamespacesCategory,
220221
},
221222
{
222223
Name: cliutils.CmdMissionControl,
223-
Usage: "JFrog Mission Control commands.",
224+
Usage: "Mission Control commands.",
224225
Subcommands: missioncontrol.GetCommands(),
225-
Category: otherCategory,
226+
Category: commandNamespacesCategory,
226227
},
227228
{
228229
Name: cliutils.CmdDistribution,
229-
Usage: "JFrog Distribution V1 commands.",
230+
Usage: "Distribution V1 commands.",
230231
Subcommands: distribution.GetCommands(),
231-
Category: otherCategory,
232+
Category: commandNamespacesCategory,
232233
},
233234
{
234235
Name: cliutils.CmdPipelines,
235-
Usage: "JFrog Pipelines commands.",
236+
Usage: "Pipelines commands.",
236237
Subcommands: pipelines.GetCommands(),
237-
Category: otherCategory,
238+
Category: commandNamespacesCategory,
238239
},
239240
{
240241
Name: cliutils.CmdCompletion,
@@ -246,14 +247,14 @@ func getCommands() ([]cli.Command, error) {
246247
Name: cliutils.CmdPlugin,
247248
Usage: "Plugins handling commands.",
248249
Subcommands: plugins.GetCommands(),
249-
Category: otherCategory,
250+
Category: commandNamespacesCategory,
250251
},
251252
{
252253
Name: cliutils.CmdConfig,
253254
Aliases: []string{"c"},
254-
Usage: "Config server configurations commands.",
255+
Usage: "Server configurations commands.",
255256
Subcommands: config.GetCommands(),
256-
Category: otherCategory,
257+
Category: commandNamespacesCategory,
257258
},
258259
{
259260
Name: cliutils.CmdProject,
@@ -275,18 +276,16 @@ func getCommands() ([]cli.Command, error) {
275276
},
276277
},
277278
{
278-
Name: "setup",
279-
HideHelp: true,
280-
Hidden: true,
281-
Flags: cliutils.GetCommandFlags(cliutils.Setup),
282-
Action: SetupCmd,
279+
Name: "setup",
280+
Hidden: true,
281+
Flags: cliutils.GetCommandFlags(cliutils.Setup),
282+
Action: SetupCmd,
283283
},
284284
{
285-
Name: "intro",
286-
HideHelp: true,
287-
Hidden: true,
288-
Flags: cliutils.GetCommandFlags(cliutils.Intro),
289-
Action: IntroCmd,
285+
Name: "intro",
286+
Hidden: true,
287+
Flags: cliutils.GetCommandFlags(cliutils.Intro),
288+
Action: IntroCmd,
290289
},
291290
{
292291
Name: cliutils.CmdOptions,
@@ -322,6 +321,7 @@ func getCommands() ([]cli.Command, error) {
322321
UsageText: tokenDocs.GetArguments(),
323322
ArgsUsage: common.CreateEnvVars(),
324323
BashComplete: corecommon.CreateBashCompletionFunc(),
324+
Category: otherCategory,
325325
Action: token.AccessTokenCreateCmd,
326326
},
327327
}

0 commit comments

Comments
 (0)