Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-cmds
Commits
e765d870
Commit
e765d870
authored
Nov 15, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmds: root: fix '--help' notice for subcmds
parent
c01c951a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
cli/helptext.go
cli/helptext.go
+5
-1
No files found.
cli/helptext.go
View file @
e765d870
...
...
@@ -33,6 +33,7 @@ type helpFields struct {
Synopsis
string
Subcommands
string
Description
string
MoreHelp
bool
}
// TrimNewlines removes extra newlines from fields. This makes aligning
...
...
@@ -105,7 +106,8 @@ SYNOPSIS
{{end}}{{if .Description}}
{{.Description}}
{{end}}
Use '{{.Path}} --help' for more information about this command.
{{if .MoreHelp}}Use '{{.Path}} --help' for more information about this command.
{{end}}
`
var
usageTemplate
*
template
.
Template
...
...
@@ -141,6 +143,7 @@ func LongHelp(rootName string, root *cmds.Command, path []string, out io.Writer)
Subcommands
:
cmd
.
Helptext
.
Subcommands
,
Description
:
cmd
.
Helptext
.
ShortDescription
,
Usage
:
cmd
.
Helptext
.
Usage
,
MoreHelp
:
(
cmd
!=
root
),
}
if
len
(
cmd
.
Helptext
.
LongDescription
)
>
0
{
...
...
@@ -192,6 +195,7 @@ func ShortHelp(rootName string, root *cmds.Command, path []string, out io.Writer
Synopsis
:
cmd
.
Helptext
.
Synopsis
,
Description
:
cmd
.
Helptext
.
ShortDescription
,
Usage
:
cmd
.
Helptext
.
Usage
,
MoreHelp
:
(
cmd
!=
root
),
}
// trim the extra newlines (see TrimNewlines doc)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment