Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
haoqu.ma
/
gotty
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8758dc05
authored
Aug 21, 2015
by
Iwasaki Yudai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Isolate help message template
1 parent
25627da8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
help.go
main.go
help.go
0 → 100644
View file @
8758dc0
package
main
var
helpTemplate
=
`NAME:
{{.Name}} - {{.Usage}}
USAGE:
{{.Name}} [options] <command> [<arguments...>]
VERSION:
{{.Version}}{{if or .Author .Email}}
AUTHOR:{{if .Author}}
{{.Author}}{{if .Email}} - <{{.Email}}>{{end}}{{else}}
{{.Email}}{{end}}{{end}}
OPTIONS:
{{range .Flags}}{{.}}
{{end}}
`
main.go
View file @
8758dc0
...
...
@@ -14,6 +14,7 @@ func main() {
cmd
.
Version
=
"0.0.2"
cmd
.
Name
=
"gotty"
cmd
.
Usage
=
"Share your terminal as a web application"
cmd
.
HideHelp
=
true
cmd
.
Flags
=
[]
cli
.
Flag
{
cli
.
StringFlag
{
Name
:
"addr, a"
,
...
...
@@ -66,24 +67,7 @@ func main() {
}
}
cmd
.
HideHelp
=
true
cli
.
AppHelpTemplate
=
`NAME:
{{.Name}} - {{.Usage}}
USAGE:
{{.Name}} [options] <command> [<arguments...>]
VERSION:
{{.Version}}{{if or .Author .Email}}
AUTHOR:{{if .Author}}
{{.Author}}{{if .Email}} - <{{.Email}}>{{end}}{{else}}
{{.Email}}{{end}}{{end}}
OPTIONS:
{{range .Flags}}{{.}}
{{end}}
`
cli
.
AppHelpTemplate
=
helpTemplate
cmd
.
Run
(
os
.
Args
)
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment