-
Notifications
You must be signed in to change notification settings - Fork 75
/
doc.go
163 lines (103 loc) · 6.01 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// DO NOT EDIT THIS FILE.
// THIS FILE IS GENERATED BY GO GENERATE.
/*
Command gcli generates a skeleon (codes and its directory structure) you need to start building CLI tool by Golang.
https://github.com/tcnksm/gcli
Usage:
gcli [-version] [-help] <command> [<options>]
Available commands:
apply Apply design template file for generating cli project
design Generate project design template
list List available cli frameworks
new Generate new cli project
validate Validate design template file
Use "gcli <command> -help" for more information about command.
Apply design template file for generating cli project
Apply design template file for generating cli project. You can generate
design template file via 'gcli design' command. If framework name is not
specified gcli use codegangsta/cli. You can set framework name via '-F'
option. To check cli framework you can use, run 'gcli list'.
Usage:
gcli apply [option] FILE
Options:
-framework=name, -F Cli framework name. By default, gcli use "codegangsta/cli"
To check cli framework you can use, run 'gcli list'.
If you set invalid framework, it will be failed.
-skip-test, -T Skip generating *_test.go file. By default, gcli generates
test file If you specify this flag, gcli will not generate
test files.
Generate project design template
Generate project design template (as toml file). You can pass that file to 'gcli apply'
command and generate CLI tool based on template file. You can define what command
and what flag you need on that file.
Usage:
gcli design [option] NAME
Options:
-command=name, -c Command name which you want to add.
This is valid only when cli pacakge support commands.
This can be specified multiple times. Synopsis can be
set after ":". Namely, you can specify command by
-command=NAME:SYNOPSYS. Only NAME is required.
You can set multiple variables at same time with ","
separator.
-flag=name, -f Global flag option name which you want to add.
This can be specified multiple times. By default, flag type
is string and its description is empty. You can set them,
with ":" separator. Namaly, you can specify flag by
-flag=NAME:TYPE:DESCIRPTION. Order must be flow this and
TYPE must be string, bool or int. Only NAME is required.
You can set multiple variables at same time with ","
separator.
-framework=name, -F Cli framework name. By default, gcli use "codegangsta/cli"
To check cli framework you can use, run 'gcli list'.
If you set invalid framework, it will be failed.
-owner=name, -o Command owner (author) name. This value is also used for
import path name. By default, owner name is extracted from
~/.gitconfig variable.
-output, -O Change output file name. By default, gcli use "NAME-design.toml"
List available cli frameworks
Show all avairable cli frameworks.
Usage:
gcli list
Generate new cli project
Generate new cli skeleton project. At least, you must provide executable
name. You can select cli package and set commands via command line option.
See more about that on Options section. By default, gcli use codegangsta/cli.
To check cli framework you can use, run 'gcli list'.
Usage:
gcli new [option] NAME
Options:
-command=name, -c Command name which you want to add.
This is valid only when cli pacakge support commands.
This can be specified multiple times. Synopsis can be
set after ":". Namely, you can specify command by
-command=NAME:SYNOPSYS. Only NAME is required.
You can set multiple variables at same time with ","
separator.
-flag=name, -f Global flag option name which you want to add.
This can be specified multiple times. By default, flag type
is string and its description is empty. You can set them,
with ":" separator. Namaly, you can specify flag by
-flag=NAME:TYPE:DESCIRPTION. Order must be flow this and
TYPE must be string, bool or int. Only NAME is required.
You can set multiple variables at same time with ","
separator.
-framework=name, -F Cli framework name. By default, gcli use "codegangsta/cli"
To check cli framework you can use, run 'gcli list'.
If you set invalid framework, it will be failed.
-owner=name, -o Command owner (author) name. This value is also used for
import path name. By default, owner name is extracted from
~/.gitconfig variable.
-skip-test, -T Skip generating *_test.go file. By default, gcli generates
test file If you specify this flag, gcli will not generate
test files.
Examples:
To create todo command application skeleton which has 'add' and 'delete' command,
$ gcli new -command=add:"Add new task" -command=delete:"delete task" todo
Validate design template file
Validate design template file which has required filed. If not it returns
error and non zero value.
Usage:
gcli validate FILE
*/
package main