You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3602 lines
114 KiB

8 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <meta name="theme-color" content="#375EAB">
  7. <title>cli - The Go Programming Language</title>
  8. <link type="text/css" rel="stylesheet" href="../../../../lib/godoc/style.css">
  9. <link rel="stylesheet" href="../../../../lib/godoc/jquery.treeview.css">
  10. <script type="text/javascript">window.initFuncs = [];</script>
  11. </head>
  12. <body>
  13. <div id='lowframe' style="position: fixed; bottom: 0; left: 0; height: 0; width: 100%; border-top: thin solid grey; background-color: white; overflow: auto;">
  14. ...
  15. </div><!-- #lowframe -->
  16. <div id="topbar" class="wide"><div class="container">
  17. <div class="top-heading" id="heading-wide"><a href="http://localhost:6060/">The Go Programming Language</a></div>
  18. <div class="top-heading" id="heading-narrow"><a href="http://localhost:6060/">Go</a></div>
  19. <a href="index.html#" id="menu-button"><span id="menu-button-arrow">&#9661;</span></a>
  20. <form method="GET" action="http://localhost:6060/search">
  21. <div id="menu">
  22. <a href="http://localhost:6060/doc/">Documents</a>
  23. <a href="http://localhost:6060/pkg/">Packages</a>
  24. <a href="http://localhost:6060/project/">The Project</a>
  25. <a href="http://localhost:6060/help/">Help</a>
  26. <a href="http://localhost:6060/blog/">Blog</a>
  27. <input type="text" id="search" name="q" class="inactive" value="Search" placeholder="Search">
  28. </div>
  29. </form>
  30. </div></div>
  31. <div id="page" class="wide">
  32. <div class="container">
  33. <h1>Package cli</h1>
  34. <div id="nav"></div>
  35. <!--
  36. Copyright 2009 The Go Authors. All rights reserved.
  37. Use of this source code is governed by a BSD-style
  38. license that can be found in the LICENSE file.
  39. -->
  40. <!--
  41. Note: Static (i.e., not template-generated) href and id
  42. attributes start with "pkg-" to make it impossible for
  43. them to conflict with generated attributes (some of which
  44. correspond to Go identifiers).
  45. -->
  46. <script type='text/javascript'>
  47. document.ANALYSIS_DATA = null;
  48. document.CALLGRAPH = null;
  49. </script>
  50. <div id="short-nav">
  51. <dl>
  52. <dd><code>import "github.com/codegangsta/cli"</code></dd>
  53. </dl>
  54. <dl>
  55. <dd><a href="index.html#pkg-overview" class="overviewLink">Overview</a></dd>
  56. <dd><a href="index.html#pkg-index" class="indexLink">Index</a></dd>
  57. <dd><a href="index.html#pkg-examples" class="examplesLink">Examples</a></dd>
  58. <dd><a href="index.html#pkg-subdirectories">Subdirectories</a></dd>
  59. </dl>
  60. </div>
  61. <!-- The package's Name is printed as title by the top-level template -->
  62. <div id="pkg-overview" class="toggleVisible">
  63. <div class="collapsed">
  64. <h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
  65. </div>
  66. <div class="expanded">
  67. <h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
  68. <p>
  69. Package cli provides a minimal framework for creating and organizing command line
  70. Go applications. cli is designed to be easy to understand and write, the most simple
  71. cli application can be written as follows:
  72. </p>
  73. <pre>func main() {
  74. cli.NewApp().Run(os.Args)
  75. }
  76. </pre>
  77. <p>
  78. Of course this application does not do much, so let&#39;s make this an actual application:
  79. </p>
  80. <pre>func main() {
  81. app := cli.NewApp()
  82. app.Name = &#34;greet&#34;
  83. app.Usage = &#34;say a greeting&#34;
  84. app.Action = func(c *cli.Context) error {
  85. println(&#34;Greetings&#34;)
  86. }
  87. app.Run(os.Args)
  88. }
  89. </pre>
  90. </div>
  91. </div>
  92. <div id="pkg-index" class="toggleVisible">
  93. <div class="collapsed">
  94. <h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
  95. </div>
  96. <div class="expanded">
  97. <h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>
  98. <!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
  99. <div id="manual-nav">
  100. <dl>
  101. <dd><a href="index.html#pkg-variables">Variables</a></dd>
  102. <dd><a href="index.html#DefaultAppComplete">func DefaultAppComplete(c *Context)</a></dd>
  103. <dd><a href="index.html#HandleAction">func HandleAction(action interface{}, context *Context) (err error)</a></dd>
  104. <dd><a href="index.html#HandleExitCoder">func HandleExitCoder(err error)</a></dd>
  105. <dd><a href="index.html#ShowAppHelp">func ShowAppHelp(c *Context) error</a></dd>
  106. <dd><a href="index.html#ShowCommandCompletions">func ShowCommandCompletions(ctx *Context, command string)</a></dd>
  107. <dd><a href="index.html#ShowCommandHelp">func ShowCommandHelp(ctx *Context, command string) error</a></dd>
  108. <dd><a href="index.html#ShowCompletions">func ShowCompletions(c *Context)</a></dd>
  109. <dd><a href="index.html#ShowSubcommandHelp">func ShowSubcommandHelp(c *Context) error</a></dd>
  110. <dd><a href="index.html#ShowVersion">func ShowVersion(c *Context)</a></dd>
  111. <dd><a href="index.html#ActionFunc">type ActionFunc</a></dd>
  112. <dd><a href="index.html#AfterFunc">type AfterFunc</a></dd>
  113. <dd><a href="index.html#App">type App</a></dd>
  114. <dd>&nbsp; &nbsp; <a href="index.html#NewApp">func NewApp() *App</a></dd>
  115. <dd>&nbsp; &nbsp; <a href="index.html#App.Categories">func (a *App) Categories() CommandCategories</a></dd>
  116. <dd>&nbsp; &nbsp; <a href="index.html#App.Command">func (a *App) Command(name string) *Command</a></dd>
  117. <dd>&nbsp; &nbsp; <a href="index.html#App.Run">func (a *App) Run(arguments []string) (err error)</a></dd>
  118. <dd>&nbsp; &nbsp; <a href="index.html#App.RunAndExitOnError">func (a *App) RunAndExitOnError()</a></dd>
  119. <dd>&nbsp; &nbsp; <a href="index.html#App.RunAsSubcommand">func (a *App) RunAsSubcommand(ctx *Context) (err error)</a></dd>
  120. <dd>&nbsp; &nbsp; <a href="index.html#App.Setup">func (a *App) Setup()</a></dd>
  121. <dd>&nbsp; &nbsp; <a href="index.html#App.VisibleCategories">func (a *App) VisibleCategories() []*CommandCategory</a></dd>
  122. <dd>&nbsp; &nbsp; <a href="index.html#App.VisibleCommands">func (a *App) VisibleCommands() []Command</a></dd>
  123. <dd>&nbsp; &nbsp; <a href="index.html#App.VisibleFlags">func (a *App) VisibleFlags() []Flag</a></dd>
  124. <dd><a href="index.html#Args">type Args</a></dd>
  125. <dd>&nbsp; &nbsp; <a href="index.html#Args.First">func (a Args) First() string</a></dd>
  126. <dd>&nbsp; &nbsp; <a href="index.html#Args.Get">func (a Args) Get(n int) string</a></dd>
  127. <dd>&nbsp; &nbsp; <a href="index.html#Args.Present">func (a Args) Present() bool</a></dd>
  128. <dd>&nbsp; &nbsp; <a href="index.html#Args.Swap">func (a Args) Swap(from, to int) error</a></dd>
  129. <dd>&nbsp; &nbsp; <a href="index.html#Args.Tail">func (a Args) Tail() []string</a></dd>
  130. <dd><a href="index.html#Author">type Author</a></dd>
  131. <dd>&nbsp; &nbsp; <a href="index.html#Author.String">func (a Author) String() string</a></dd>
  132. <dd><a href="index.html#BashCompleteFunc">type BashCompleteFunc</a></dd>
  133. <dd><a href="index.html#BeforeFunc">type BeforeFunc</a></dd>
  134. <dd><a href="index.html#BoolFlag">type BoolFlag</a></dd>
  135. <dd>&nbsp; &nbsp; <a href="index.html#BoolFlag.Apply">func (f BoolFlag) Apply(set *flag.FlagSet)</a></dd>
  136. <dd>&nbsp; &nbsp; <a href="index.html#BoolFlag.GetName">func (f BoolFlag) GetName() string</a></dd>
  137. <dd>&nbsp; &nbsp; <a href="index.html#BoolFlag.String">func (f BoolFlag) String() string</a></dd>
  138. <dd><a href="index.html#BoolTFlag">type BoolTFlag</a></dd>
  139. <dd>&nbsp; &nbsp; <a href="index.html#BoolTFlag.Apply">func (f BoolTFlag) Apply(set *flag.FlagSet)</a></dd>
  140. <dd>&nbsp; &nbsp; <a href="index.html#BoolTFlag.GetName">func (f BoolTFlag) GetName() string</a></dd>
  141. <dd>&nbsp; &nbsp; <a href="index.html#BoolTFlag.String">func (f BoolTFlag) String() string</a></dd>
  142. <dd><a href="index.html#Command">type Command</a></dd>
  143. <dd>&nbsp; &nbsp; <a href="index.html#Command.FullName">func (c Command) FullName() string</a></dd>
  144. <dd>&nbsp; &nbsp; <a href="index.html#Command.HasName">func (c Command) HasName(name string) bool</a></dd>
  145. <dd>&nbsp; &nbsp; <a href="index.html#Command.Names">func (c Command) Names() []string</a></dd>
  146. <dd>&nbsp; &nbsp; <a href="index.html#Command.Run">func (c Command) Run(ctx *Context) (err error)</a></dd>
  147. <dd>&nbsp; &nbsp; <a href="index.html#Command.VisibleFlags">func (c Command) VisibleFlags() []Flag</a></dd>
  148. <dd><a href="index.html#CommandCategories">type CommandCategories</a></dd>
  149. <dd>&nbsp; &nbsp; <a href="index.html#CommandCategories.AddCommand">func (c CommandCategories) AddCommand(category string, command Command) CommandCategories</a></dd>
  150. <dd>&nbsp; &nbsp; <a href="index.html#CommandCategories.Len">func (c CommandCategories) Len() int</a></dd>
  151. <dd>&nbsp; &nbsp; <a href="index.html#CommandCategories.Less">func (c CommandCategories) Less(i, j int) bool</a></dd>
  152. <dd>&nbsp; &nbsp; <a href="index.html#CommandCategories.Swap">func (c CommandCategories) Swap(i, j int)</a></dd>
  153. <dd><a href="index.html#CommandCategory">type CommandCategory</a></dd>
  154. <dd>&nbsp; &nbsp; <a href="index.html#CommandCategory.VisibleCommands">func (c *CommandCategory) VisibleCommands() []Command</a></dd>
  155. <dd><a href="index.html#CommandNotFoundFunc">type CommandNotFoundFunc</a></dd>
  156. <dd><a href="index.html#Commands">type Commands</a></dd>
  157. <dd><a href="index.html#Context">type Context</a></dd>
  158. <dd>&nbsp; &nbsp; <a href="index.html#NewContext">func NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context</a></dd>
  159. <dd>&nbsp; &nbsp; <a href="index.html#Context.Args">func (c *Context) Args() Args</a></dd>
  160. <dd>&nbsp; &nbsp; <a href="index.html#Context.Bool">func (c *Context) Bool(name string) bool</a></dd>
  161. <dd>&nbsp; &nbsp; <a href="index.html#Context.BoolT">func (c *Context) BoolT(name string) bool</a></dd>
  162. <dd>&nbsp; &nbsp; <a href="index.html#Context.Duration">func (c *Context) Duration(name string) time.Duration</a></dd>
  163. <dd>&nbsp; &nbsp; <a href="index.html#Context.FlagNames">func (c *Context) FlagNames() (names []string)</a></dd>
  164. <dd>&nbsp; &nbsp; <a href="index.html#Context.Float64">func (c *Context) Float64(name string) float64</a></dd>
  165. <dd>&nbsp; &nbsp; <a href="index.html#Context.Generic">func (c *Context) Generic(name string) interface{}</a></dd>
  166. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalBool">func (c *Context) GlobalBool(name string) bool</a></dd>
  167. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalBoolT">func (c *Context) GlobalBoolT(name string) bool</a></dd>
  168. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalDuration">func (c *Context) GlobalDuration(name string) time.Duration</a></dd>
  169. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalFlagNames">func (c *Context) GlobalFlagNames() (names []string)</a></dd>
  170. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalFloat64">func (c *Context) GlobalFloat64(name string) float64</a></dd>
  171. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalGeneric">func (c *Context) GlobalGeneric(name string) interface{}</a></dd>
  172. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalInt">func (c *Context) GlobalInt(name string) int</a></dd>
  173. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalInt64">func (c *Context) GlobalInt64(name string) int64</a></dd>
  174. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalInt64Slice">func (c *Context) GlobalInt64Slice(name string) []int64</a></dd>
  175. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalIntSlice">func (c *Context) GlobalIntSlice(name string) []int</a></dd>
  176. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalIsSet">func (c *Context) GlobalIsSet(name string) bool</a></dd>
  177. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalSet">func (c *Context) GlobalSet(name, value string) error</a></dd>
  178. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalString">func (c *Context) GlobalString(name string) string</a></dd>
  179. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalStringSlice">func (c *Context) GlobalStringSlice(name string) []string</a></dd>
  180. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalUint">func (c *Context) GlobalUint(name string) uint</a></dd>
  181. <dd>&nbsp; &nbsp; <a href="index.html#Context.GlobalUint64">func (c *Context) GlobalUint64(name string) uint64</a></dd>
  182. <dd>&nbsp; &nbsp; <a href="index.html#Context.Int">func (c *Context) Int(name string) int</a></dd>
  183. <dd>&nbsp; &nbsp; <a href="index.html#Context.Int64">func (c *Context) Int64(name string) int64</a></dd>
  184. <dd>&nbsp; &nbsp; <a href="index.html#Context.Int64Slice">func (c *Context) Int64Slice(name string) []int64</a></dd>
  185. <dd>&nbsp; &nbsp; <a href="index.html#Context.IntSlice">func (c *Context) IntSlice(name string) []int</a></dd>
  186. <dd>&nbsp; &nbsp; <a href="index.html#Context.IsSet">func (c *Context) IsSet(name string) bool</a></dd>
  187. <dd>&nbsp; &nbsp; <a href="index.html#Context.NArg">func (c *Context) NArg() int</a></dd>
  188. <dd>&nbsp; &nbsp; <a href="index.html#Context.NumFlags">func (c *Context) NumFlags() int</a></dd>
  189. <dd>&nbsp; &nbsp; <a href="index.html#Context.Parent">func (c *Context) Parent() *Context</a></dd>
  190. <dd>&nbsp; &nbsp; <a href="index.html#Context.Set">func (c *Context) Set(name, value string) error</a></dd>
  191. <dd>&nbsp; &nbsp; <a href="index.html#Context.String">func (c *Context) String(name string) string</a></dd>
  192. <dd>&nbsp; &nbsp; <a href="index.html#Context.StringSlice">func (c *Context) StringSlice(name string) []string</a></dd>
  193. <dd>&nbsp; &nbsp; <a href="index.html#Context.Uint">func (c *Context) Uint(name string) uint</a></dd>
  194. <dd>&nbsp; &nbsp; <a href="index.html#Context.Uint64">func (c *Context) Uint64(name string) uint64</a></dd>
  195. <dd><a href="index.html#DurationFlag">type DurationFlag</a></dd>
  196. <dd>&nbsp; &nbsp; <a href="index.html#DurationFlag.Apply">func (f DurationFlag) Apply(set *flag.FlagSet)</a></dd>
  197. <dd>&nbsp; &nbsp; <a href="index.html#DurationFlag.GetName">func (f DurationFlag) GetName() string</a></dd>
  198. <dd>&nbsp; &nbsp; <a href="index.html#DurationFlag.String">func (f DurationFlag) String() string</a></dd>
  199. <dd><a href="index.html#ExitCoder">type ExitCoder</a></dd>
  200. <dd><a href="index.html#ExitError">type ExitError</a></dd>
  201. <dd>&nbsp; &nbsp; <a href="index.html#NewExitError">func NewExitError(message string, exitCode int) *ExitError</a></dd>
  202. <dd>&nbsp; &nbsp; <a href="index.html#ExitError.Error">func (ee *ExitError) Error() string</a></dd>
  203. <dd>&nbsp; &nbsp; <a href="index.html#ExitError.ExitCode">func (ee *ExitError) ExitCode() int</a></dd>
  204. <dd><a href="index.html#Flag">type Flag</a></dd>
  205. <dd><a href="index.html#FlagStringFunc">type FlagStringFunc</a></dd>
  206. <dd><a href="index.html#Float64Flag">type Float64Flag</a></dd>
  207. <dd>&nbsp; &nbsp; <a href="index.html#Float64Flag.Apply">func (f Float64Flag) Apply(set *flag.FlagSet)</a></dd>
  208. <dd>&nbsp; &nbsp; <a href="index.html#Float64Flag.GetName">func (f Float64Flag) GetName() string</a></dd>
  209. <dd>&nbsp; &nbsp; <a href="index.html#Float64Flag.String">func (f Float64Flag) String() string</a></dd>
  210. <dd><a href="index.html#Generic">type Generic</a></dd>
  211. <dd><a href="index.html#GenericFlag">type GenericFlag</a></dd>
  212. <dd>&nbsp; &nbsp; <a href="index.html#GenericFlag.Apply">func (f GenericFlag) Apply(set *flag.FlagSet)</a></dd>
  213. <dd>&nbsp; &nbsp; <a href="index.html#GenericFlag.GetName">func (f GenericFlag) GetName() string</a></dd>
  214. <dd>&nbsp; &nbsp; <a href="index.html#GenericFlag.String">func (f GenericFlag) String() string</a></dd>
  215. <dd><a href="index.html#Int64Flag">type Int64Flag</a></dd>
  216. <dd>&nbsp; &nbsp; <a href="index.html#Int64Flag.Apply">func (f Int64Flag) Apply(set *flag.FlagSet)</a></dd>
  217. <dd>&nbsp; &nbsp; <a href="index.html#Int64Flag.GetName">func (f Int64Flag) GetName() string</a></dd>
  218. <dd>&nbsp; &nbsp; <a href="index.html#Int64Flag.String">func (f Int64Flag) String() string</a></dd>
  219. <dd><a href="index.html#Int64Slice">type Int64Slice</a></dd>
  220. <dd>&nbsp; &nbsp; <a href="index.html#Int64Slice.Set">func (f *Int64Slice) Set(value string) error</a></dd>
  221. <dd>&nbsp; &nbsp; <a href="index.html#Int64Slice.String">func (f *Int64Slice) String() string</a></dd>
  222. <dd>&nbsp; &nbsp; <a href="index.html#Int64Slice.Value">func (f *Int64Slice) Value() []int64</a></dd>
  223. <dd><a href="index.html#Int64SliceFlag">type Int64SliceFlag</a></dd>
  224. <dd>&nbsp; &nbsp; <a href="index.html#Int64SliceFlag.Apply">func (f Int64SliceFlag) Apply(set *flag.FlagSet)</a></dd>
  225. <dd>&nbsp; &nbsp; <a href="index.html#Int64SliceFlag.GetName">func (f Int64SliceFlag) GetName() string</a></dd>
  226. <dd>&nbsp; &nbsp; <a href="index.html#Int64SliceFlag.String">func (f Int64SliceFlag) String() string</a></dd>
  227. <dd><a href="index.html#IntFlag">type IntFlag</a></dd>
  228. <dd>&nbsp; &nbsp; <a href="index.html#IntFlag.Apply">func (f IntFlag) Apply(set *flag.FlagSet)</a></dd>
  229. <dd>&nbsp; &nbsp; <a href="index.html#IntFlag.GetName">func (f IntFlag) GetName() string</a></dd>
  230. <dd>&nbsp; &nbsp; <a href="index.html#IntFlag.String">func (f IntFlag) String() string</a></dd>
  231. <dd><a href="index.html#IntSlice">type IntSlice</a></dd>
  232. <dd>&nbsp; &nbsp; <a href="index.html#IntSlice.Set">func (f *IntSlice) Set(value string) error</a></dd>
  233. <dd>&nbsp; &nbsp; <a href="index.html#IntSlice.String">func (f *IntSlice) String() string</a></dd>
  234. <dd>&nbsp; &nbsp; <a href="index.html#IntSlice.Value">func (f *IntSlice) Value() []int</a></dd>
  235. <dd><a href="index.html#IntSliceFlag">type IntSliceFlag</a></dd>
  236. <dd>&nbsp; &nbsp; <a href="index.html#IntSliceFlag.Apply">func (f IntSliceFlag) Apply(set *flag.FlagSet)</a></dd>
  237. <dd>&nbsp; &nbsp; <a href="index.html#IntSliceFlag.GetName">func (f IntSliceFlag) GetName() string</a></dd>
  238. <dd>&nbsp; &nbsp; <a href="index.html#IntSliceFlag.String">func (f IntSliceFlag) String() string</a></dd>
  239. <dd><a href="index.html#MultiError">type MultiError</a></dd>
  240. <dd>&nbsp; &nbsp; <a href="index.html#NewMultiError">func NewMultiError(err ...error) MultiError</a></dd>
  241. <dd>&nbsp; &nbsp; <a href="index.html#MultiError.Error">func (m MultiError) Error() string</a></dd>
  242. <dd><a href="index.html#OnUsageErrorFunc">type OnUsageErrorFunc</a></dd>
  243. <dd><a href="index.html#StringFlag">type StringFlag</a></dd>
  244. <dd>&nbsp; &nbsp; <a href="index.html#StringFlag.Apply">func (f StringFlag) Apply(set *flag.FlagSet)</a></dd>
  245. <dd>&nbsp; &nbsp; <a href="index.html#StringFlag.GetName">func (f StringFlag) GetName() string</a></dd>
  246. <dd>&nbsp; &nbsp; <a href="index.html#StringFlag.String">func (f StringFlag) String() string</a></dd>
  247. <dd><a href="index.html#StringSlice">type StringSlice</a></dd>
  248. <dd>&nbsp; &nbsp; <a href="index.html#StringSlice.Set">func (f *StringSlice) Set(value string) error</a></dd>
  249. <dd>&nbsp; &nbsp; <a href="index.html#StringSlice.String">func (f *StringSlice) String() string</a></dd>
  250. <dd>&nbsp; &nbsp; <a href="index.html#StringSlice.Value">func (f *StringSlice) Value() []string</a></dd>
  251. <dd><a href="index.html#StringSliceFlag">type StringSliceFlag</a></dd>
  252. <dd>&nbsp; &nbsp; <a href="index.html#StringSliceFlag.Apply">func (f StringSliceFlag) Apply(set *flag.FlagSet)</a></dd>
  253. <dd>&nbsp; &nbsp; <a href="index.html#StringSliceFlag.GetName">func (f StringSliceFlag) GetName() string</a></dd>
  254. <dd>&nbsp; &nbsp; <a href="index.html#StringSliceFlag.String">func (f StringSliceFlag) String() string</a></dd>
  255. <dd><a href="index.html#Uint64Flag">type Uint64Flag</a></dd>
  256. <dd>&nbsp; &nbsp; <a href="index.html#Uint64Flag.Apply">func (f Uint64Flag) Apply(set *flag.FlagSet)</a></dd>
  257. <dd>&nbsp; &nbsp; <a href="index.html#Uint64Flag.GetName">func (f Uint64Flag) GetName() string</a></dd>
  258. <dd>&nbsp; &nbsp; <a href="index.html#Uint64Flag.String">func (f Uint64Flag) String() string</a></dd>
  259. <dd><a href="index.html#UintFlag">type UintFlag</a></dd>
  260. <dd>&nbsp; &nbsp; <a href="index.html#UintFlag.Apply">func (f UintFlag) Apply(set *flag.FlagSet)</a></dd>
  261. <dd>&nbsp; &nbsp; <a href="index.html#UintFlag.GetName">func (f UintFlag) GetName() string</a></dd>
  262. <dd>&nbsp; &nbsp; <a href="index.html#UintFlag.String">func (f UintFlag) String() string</a></dd>
  263. </dl>
  264. </div><!-- #manual-nav -->
  265. <div id="pkg-examples">
  266. <h4>Examples</h4>
  267. <dl>
  268. <dd><a class="exampleLink" href="index.html#example_App_Run">App.Run</a></dd>
  269. <dd><a class="exampleLink" href="index.html#example_App_Run_bashComplete">App.Run (BashComplete)</a></dd>
  270. <dd><a class="exampleLink" href="index.html#example_App_Run_help">App.Run (Help)</a></dd>
  271. <dd><a class="exampleLink" href="index.html#example_App_Run_subcommand">App.Run (Subcommand)</a></dd>
  272. </dl>
  273. </div>
  274. <h4>Package files</h4>
  275. <p>
  276. <span style="font-size:90%">
  277. <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go">app.go</a>
  278. <a href="http://localhost:6060/src/github.com/codegangsta/cli/category.go">category.go</a>
  279. <a href="http://localhost:6060/src/github.com/codegangsta/cli/cli.go">cli.go</a>
  280. <a href="http://localhost:6060/src/github.com/codegangsta/cli/command.go">command.go</a>
  281. <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go">context.go</a>
  282. <a href="http://localhost:6060/src/github.com/codegangsta/cli/errors.go">errors.go</a>
  283. <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go">flag.go</a>
  284. <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go">flag_generated.go</a>
  285. <a href="http://localhost:6060/src/github.com/codegangsta/cli/funcs.go">funcs.go</a>
  286. <a href="http://localhost:6060/src/github.com/codegangsta/cli/help.go">help.go</a>
  287. </span>
  288. </p>
  289. </div><!-- .expanded -->
  290. </div><!-- #pkg-index -->
  291. <div id="pkg-callgraph" class="toggle" style="display: none">
  292. <div class="collapsed">
  293. <h2 class="toggleButton" title="Click to show Internal Call Graph section">Internal call graph ▹</h2>
  294. </div> <!-- .expanded -->
  295. <div class="expanded">
  296. <h2 class="toggleButton" title="Click to hide Internal Call Graph section">Internal call graph ▾</h2>
  297. <p>
  298. In the call graph viewer below, each node
  299. is a function belonging to this package
  300. and its children are the functions it
  301. calls&mdash;perhaps dynamically.
  302. </p>
  303. <p>
  304. The root nodes are the entry points of the
  305. package: functions that may be called from
  306. outside the package.
  307. There may be non-exported or anonymous
  308. functions among them if they are called
  309. dynamically from another package.
  310. </p>
  311. <p>
  312. Click a node to visit that function's source code.
  313. From there you can visit its callers by
  314. clicking its declaring <code>func</code>
  315. token.
  316. </p>
  317. <p>
  318. Functions may be omitted if they were
  319. determined to be unreachable in the
  320. particular programs or tests that were
  321. analyzed.
  322. </p>
  323. <!-- Zero means show all package entry points. -->
  324. <ul style="margin-left: 0.5in" id="callgraph-0" class="treeview"></ul>
  325. </div>
  326. </div> <!-- #pkg-callgraph -->
  327. <h2 id="pkg-variables">Variables</h2>
  328. <pre>var <span id="AppHelpTemplate">AppHelpTemplate</span> = `NAME:
  329. {{.Name}} - {{.Usage}}
  330. USAGE:
  331. {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}
  332. {{if .Version}}{{if not .HideVersion}}
  333. VERSION:
  334. {{.Version}}
  335. {{end}}{{end}}{{if len .Authors}}
  336. AUTHOR(S):
  337. {{range .Authors}}{{.}}{{end}}
  338. {{end}}{{if .VisibleCommands}}
  339. COMMANDS:{{range .VisibleCategories}}{{if .Name}}
  340. {{.Name}}:{{end}}{{range .VisibleCommands}}
  341. {{join .Names &#34;, &#34;}}{{&#34;\t&#34;}}{{.Usage}}{{end}}
  342. {{end}}{{end}}{{if .VisibleFlags}}
  343. GLOBAL OPTIONS:
  344. {{range .VisibleFlags}}{{.}}
  345. {{end}}{{end}}{{if .Copyright}}
  346. COPYRIGHT:
  347. {{.Copyright}}
  348. {{end}}
  349. `</pre>
  350. <p>
  351. AppHelpTemplate is the text template for the Default help topic.
  352. cli.go uses text/template to render templates. You can
  353. render custom help text by setting this variable.
  354. </p>
  355. <pre>var <span id="BashCompletionFlag">BashCompletionFlag</span> = <a href="index.html#BoolFlag">BoolFlag</a>{
  356. <a href="index.html#Name">Name</a>: &#34;generate-bash-completion&#34;,
  357. <a href="index.html#Hidden">Hidden</a>: <a href="../../../builtin/index.html#true">true</a>,
  358. }</pre>
  359. <p>
  360. BashCompletionFlag enables bash-completion for all commands and subcommands
  361. </p>
  362. <pre>var <span id="CommandHelpTemplate">CommandHelpTemplate</span> = `NAME:
  363. {{.HelpName}} - {{.Usage}}
  364. USAGE:
  365. {{.HelpName}}{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{if .Category}}
  366. CATEGORY:
  367. {{.Category}}{{end}}{{if .Description}}
  368. DESCRIPTION:
  369. {{.Description}}{{end}}{{if .VisibleFlags}}
  370. OPTIONS:
  371. {{range .VisibleFlags}}{{.}}
  372. {{end}}{{end}}
  373. `</pre>
  374. <p>
  375. CommandHelpTemplate is the text template for the command help topic.
  376. cli.go uses text/template to render templates. You can
  377. render custom help text by setting this variable.
  378. </p>
  379. <pre>var <span id="ErrWriter">ErrWriter</span> <a href="../../../io/index.html">io</a>.<a href="../../../io/index.html#Writer">Writer</a> = <a href="../../../os/index.html">os</a>.<a href="../../../os/index.html#Stderr">Stderr</a></pre>
  380. <p>
  381. ErrWriter is used to write errors to the user. This can be anything
  382. implementing the io.Writer interface and defaults to os.Stderr.
  383. </p>
  384. <pre>var <span id="HelpFlag">HelpFlag</span> = <a href="index.html#BoolFlag">BoolFlag</a>{
  385. <a href="index.html#Name">Name</a>: &#34;help, h&#34;,
  386. <a href="index.html#Usage">Usage</a>: &#34;show help&#34;,
  387. }</pre>
  388. <p>
  389. HelpFlag prints the help for all commands and subcommands
  390. Set to the zero value (BoolFlag{}) to disable flag -- keeps subcommand
  391. unless HideHelp is set to true)
  392. </p>
  393. <pre>var <span id="HelpPrinter">HelpPrinter</span> helpPrinter = printHelp</pre>
  394. <p>
  395. HelpPrinter is a function that writes the help output. If not set a default
  396. is used. The function signature is:
  397. func(w io.Writer, templ string, data interface{})
  398. </p>
  399. <pre>var <span id="OsExiter">OsExiter</span> = <a href="../../../os/index.html">os</a>.<a href="../../../os/index.html#Exit">Exit</a></pre>
  400. <p>
  401. OsExiter is the function used when the app exits. If not set defaults to os.Exit.
  402. </p>
  403. <pre>var <span id="SubcommandHelpTemplate">SubcommandHelpTemplate</span> = `NAME:
  404. {{.HelpName}} - {{.Usage}}
  405. USAGE:
  406. {{.HelpName}} command{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}
  407. COMMANDS:{{range .VisibleCategories}}{{if .Name}}
  408. {{.Name}}:{{end}}{{range .VisibleCommands}}
  409. {{join .Names &#34;, &#34;}}{{&#34;\t&#34;}}{{.Usage}}{{end}}
  410. {{end}}{{if .VisibleFlags}}
  411. OPTIONS:
  412. {{range .VisibleFlags}}{{.}}
  413. {{end}}{{end}}
  414. `</pre>
  415. <p>
  416. SubcommandHelpTemplate is the text template for the subcommand help topic.
  417. cli.go uses text/template to render templates. You can
  418. render custom help text by setting this variable.
  419. </p>
  420. <pre>var <span id="VersionFlag">VersionFlag</span> = <a href="index.html#BoolFlag">BoolFlag</a>{
  421. <a href="index.html#Name">Name</a>: &#34;version, v&#34;,
  422. <a href="index.html#Usage">Usage</a>: &#34;print the version&#34;,
  423. }</pre>
  424. <p>
  425. VersionFlag prints the version for the application
  426. </p>
  427. <pre>var <span id="VersionPrinter">VersionPrinter</span> = printVersion</pre>
  428. <p>
  429. VersionPrinter prints the version for the App
  430. </p>
  431. <h2 id="DefaultAppComplete">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/help.go?s=3542:3577#L116">DefaultAppComplete</a></h2>
  432. <pre>func DefaultAppComplete(c *<a href="index.html#Context">Context</a>)</pre>
  433. <p>
  434. DefaultAppComplete prints the list of subcommands as the default app completion method
  435. </p>
  436. <h2 id="HandleAction">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=11470:11537#L459">HandleAction</a></h2>
  437. <pre>func HandleAction(action interface{}, context *<a href="index.html#Context">Context</a>) (err <a href="../../../builtin/index.html#error">error</a>)</pre>
  438. <p>
  439. HandleAction uses ✧✧✧reflection✧✧✧ to figure out if the given Action is an
  440. ActionFunc, a func with the legacy signature for Action, or some other
  441. invalid thing. If it&#39;s an ActionFunc or a func with the legacy signature for
  442. Action, the func is run!
  443. </p>
  444. <h2 id="HandleExitCoder">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/errors.go?s=1816:1847#L64">HandleExitCoder</a></h2>
  445. <pre>func HandleExitCoder(err <a href="../../../builtin/index.html#error">error</a>)</pre>
  446. <p>
  447. HandleExitCoder checks if the error fulfills the ExitCoder interface, and if
  448. so prints the error to stderr (if it is non-empty) and calls OsExiter with the
  449. given exit code. If the given error is a MultiError, then this func is
  450. called on all members of the Errors slice.
  451. </p>
  452. <h2 id="ShowAppHelp">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/help.go?s=3349:3383#L110">ShowAppHelp</a></h2>
  453. <pre>func ShowAppHelp(c *<a href="index.html#Context">Context</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  454. <p>
  455. ShowAppHelp is an action that displays the help.
  456. </p>
  457. <h2 id="ShowCommandCompletions">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/help.go?s=4950:5007#L173">ShowCommandCompletions</a></h2>
  458. <pre>func ShowCommandCompletions(ctx *<a href="index.html#Context">Context</a>, command <a href="../../../builtin/index.html#string">string</a>)</pre>
  459. <p>
  460. ShowCommandCompletions prints the custom completions for a given command
  461. </p>
  462. <h2 id="ShowCommandHelp">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/help.go?s=3800:3856#L128">ShowCommandHelp</a></h2>
  463. <pre>func ShowCommandHelp(ctx *<a href="index.html#Context">Context</a>, command <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  464. <p>
  465. ShowCommandHelp prints help for the given command
  466. </p>
  467. <h2 id="ShowCompletions">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/help.go?s=4761:4793#L165">ShowCompletions</a></h2>
  468. <pre>func ShowCompletions(c *<a href="index.html#Context">Context</a>)</pre>
  469. <p>
  470. ShowCompletions prints the lists of commands within a given context
  471. </p>
  472. <h2 id="ShowSubcommandHelp">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/help.go?s=4387:4428#L151">ShowSubcommandHelp</a></h2>
  473. <pre>func ShowSubcommandHelp(c *<a href="index.html#Context">Context</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  474. <p>
  475. ShowSubcommandHelp prints help for the given subcommand
  476. </p>
  477. <h2 id="ShowVersion">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/help.go?s=4529:4557#L156">ShowVersion</a></h2>
  478. <pre>func ShowVersion(c *<a href="index.html#Context">Context</a>)</pre>
  479. <p>
  480. ShowVersion prints the version number of the App
  481. </p>
  482. <h2 id="ActionFunc">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/funcs.go?s=582:618#L5">ActionFunc</a></h2>
  483. <pre>type ActionFunc func(*<a href="index.html#Context">Context</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  484. <p>
  485. ActionFunc is the action to execute when no subcommands are specified
  486. </p>
  487. <h2 id="AfterFunc">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/funcs.go?s=472:507#L2">AfterFunc</a></h2>
  488. <pre>type AfterFunc func(*<a href="index.html#Context">Context</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  489. <p>
  490. AfterFunc is an action to execute after any subcommands are run, but after the
  491. subcommand has finished it is run even if Action() panics
  492. </p>
  493. <h2 id="App">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=1073:3231#L22">App</a></h2>
  494. <pre>type App struct {
  495. <span class="comment">// The name of the program. Defaults to path.Base(os.Args[0])</span>
  496. Name <a href="../../../builtin/index.html#string">string</a>
  497. <span class="comment">// Full name of command for help, defaults to Name</span>
  498. HelpName <a href="../../../builtin/index.html#string">string</a>
  499. <span class="comment">// Description of the program.</span>
  500. Usage <a href="../../../builtin/index.html#string">string</a>
  501. <span class="comment">// Text to override the USAGE section of help</span>
  502. UsageText <a href="../../../builtin/index.html#string">string</a>
  503. <span class="comment">// Description of the program argument format.</span>
  504. ArgsUsage <a href="../../../builtin/index.html#string">string</a>
  505. <span class="comment">// Version of the program</span>
  506. Version <a href="../../../builtin/index.html#string">string</a>
  507. <span class="comment">// List of commands to execute</span>
  508. Commands []<a href="index.html#Command">Command</a>
  509. <span class="comment">// List of flags to parse</span>
  510. Flags []<a href="index.html#Flag">Flag</a>
  511. <span class="comment">// Boolean to enable bash completion commands</span>
  512. EnableBashCompletion <a href="../../../builtin/index.html#bool">bool</a>
  513. <span class="comment">// Boolean to hide built-in help command</span>
  514. HideHelp <a href="../../../builtin/index.html#bool">bool</a>
  515. <span class="comment">// Boolean to hide built-in version flag and the VERSION section of help</span>
  516. HideVersion <a href="../../../builtin/index.html#bool">bool</a>
  517. <span class="comment">// An action to execute when the bash-completion flag is set</span>
  518. BashComplete <a href="index.html#BashCompleteFunc">BashCompleteFunc</a>
  519. <span class="comment">// An action to execute before any subcommands are run, but after the context is ready</span>
  520. <span class="comment">// If a non-nil error is returned, no subcommands are run</span>
  521. Before <a href="index.html#BeforeFunc">BeforeFunc</a>
  522. <span class="comment">// An action to execute after any subcommands are run, but after the subcommand has finished</span>
  523. <span class="comment">// It is run even if Action() panics</span>
  524. After <a href="index.html#AfterFunc">AfterFunc</a>
  525. <span class="comment">// The action to execute when no subcommands are specified</span>
  526. <span class="comment">// Expects a `cli.ActionFunc` but will accept the *deprecated* signature of `func(*cli.Context) {}`</span>
  527. <span class="comment">// *Note*: support for the deprecated `Action` signature will be removed in a future version</span>
  528. Action interface{}
  529. <span class="comment">// Execute this function if the proper command cannot be found</span>
  530. CommandNotFound <a href="index.html#CommandNotFoundFunc">CommandNotFoundFunc</a>
  531. <span class="comment">// Execute this function if an usage error occurs</span>
  532. OnUsageError <a href="index.html#OnUsageErrorFunc">OnUsageErrorFunc</a>
  533. <span class="comment">// Compilation date</span>
  534. Compiled <a href="../../../time/index.html">time</a>.<a href="../../../time/index.html#Time">Time</a>
  535. <span class="comment">// List of all authors who contributed</span>
  536. Authors []<a href="index.html#Author">Author</a>
  537. <span class="comment">// Copyright of the binary if any</span>
  538. Copyright <a href="../../../builtin/index.html#string">string</a>
  539. <span class="comment">// Name of Author (Note: Use App.Authors, this is deprecated)</span>
  540. Author <a href="../../../builtin/index.html#string">string</a>
  541. <span class="comment">// Email of Author (Note: Use App.Authors, this is deprecated)</span>
  542. Email <a href="../../../builtin/index.html#string">string</a>
  543. <span class="comment">// Writer writer to write output to</span>
  544. Writer <a href="../../../io/index.html">io</a>.<a href="../../../io/index.html#Writer">Writer</a>
  545. <span class="comment">// ErrWriter writes error output</span>
  546. ErrWriter <a href="../../../io/index.html">io</a>.<a href="../../../io/index.html#Writer">Writer</a>
  547. <span class="comment">// Other custom info</span>
  548. Metadata map[<a href="../../../builtin/index.html#string">string</a>]interface{}
  549. <span class="comment">// contains filtered or unexported fields</span>
  550. }</pre>
  551. <p>
  552. App is the main structure of a cli application. It is recommended that
  553. an app be created with the cli.NewApp() function
  554. </p>
  555. <h3 id="NewApp">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=3578:3596#L97">NewApp</a></h3>
  556. <pre>func NewApp() *<a href="index.html#App">App</a></pre>
  557. <p>
  558. NewApp creates a new cli Application with some reasonable defaults for Name,
  559. Usage, Version and Action.
  560. </p>
  561. <h3 id="App.Categories">func (*App) <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=9495:9539#L374">Categories</a></h3>
  562. <pre>func (a *<a href="index.html#App">App</a>) Categories() <a href="index.html#CommandCategories">CommandCategories</a></pre>
  563. <p>
  564. Categories returns a slice containing all the categories with the commands they contain
  565. </p>
  566. <h3 id="App.Command">func (*App) <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=9267:9310#L363">Command</a></h3>
  567. <pre>func (a *<a href="index.html#App">App</a>) Command(name <a href="../../../builtin/index.html#string">string</a>) *<a href="index.html#Command">Command</a></pre>
  568. <p>
  569. Command returns the named command on App. Returns nil if the command does not exist
  570. </p>
  571. <h3 id="App.Run">func (*App) <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=5169:5218#L162">Run</a></h3>
  572. <pre>func (a *<a href="index.html#App">App</a>) Run(arguments []<a href="../../../builtin/index.html#string">string</a>) (err <a href="../../../builtin/index.html#error">error</a>)</pre>
  573. <p>
  574. Run is the entry point to the cli app. Parses the arguments slice and routes
  575. to the proper flag/args combination
  576. </p>
  577. <div id="example_App_Run" class="toggle">
  578. <div class="collapsed">
  579. <p class="exampleHeading toggleButton"><span class="text">Example</span></p>
  580. </div>
  581. <div class="expanded">
  582. <p class="exampleHeading toggleButton"><span class="text">Example</span></p>
  583. <p>Code:</p>
  584. <pre class="code"><span class="comment">// set args for examples sake</span>
  585. os.Args = []string{&#34;greet&#34;, &#34;--name&#34;, &#34;Jeremy&#34;}
  586. app := NewApp()
  587. app.Name = &#34;greet&#34;
  588. app.Flags = []Flag{
  589. StringFlag{Name: &#34;name&#34;, Value: &#34;bob&#34;, Usage: &#34;a name to say&#34;},
  590. }
  591. app.Action = func(c *Context) error {
  592. fmt.Printf(&#34;Hello %v\n&#34;, c.String(&#34;name&#34;))
  593. return nil
  594. }
  595. app.UsageText = &#34;app [first_arg] [second_arg]&#34;
  596. app.Author = &#34;Harrison&#34;
  597. app.Email = &#34;harrison@lolwut.com&#34;
  598. app.Authors = []Author{{Name: &#34;Oliver Allen&#34;, Email: &#34;oliver@toyshop.com&#34;}}
  599. app.Run(os.Args)
  600. <span class="comment"></pre>
  601. <p>Output:</p>
  602. <pre class="output">Hello Jeremy
  603. </pre>
  604. </div>
  605. </div>
  606. <div id="example_App_Run_bashComplete" class="toggle">
  607. <div class="collapsed">
  608. <p class="exampleHeading toggleButton"><span class="text">Example (BashComplete)</span></p>
  609. </div>
  610. <div class="expanded">
  611. <p class="exampleHeading toggleButton"><span class="text">Example (BashComplete)</span></p>
  612. <p>Code:</p>
  613. <pre class="code"><span class="comment">// set args for examples sake</span>
  614. os.Args = []string{&#34;greet&#34;, &#34;--generate-bash-completion&#34;}
  615. app := NewApp()
  616. app.Name = &#34;greet&#34;
  617. app.EnableBashCompletion = true
  618. app.Commands = []Command{
  619. {
  620. Name: &#34;describeit&#34;,
  621. Aliases: []string{&#34;d&#34;},
  622. Usage: &#34;use it to see a description&#34;,
  623. Description: &#34;This is how we describe describeit the function&#34;,
  624. Action: func(c *Context) error {
  625. fmt.Printf(&#34;i like to describe things&#34;)
  626. return nil
  627. },
  628. }, {
  629. Name: &#34;next&#34;,
  630. Usage: &#34;next example&#34;,
  631. Description: &#34;more stuff to see when generating bash completion&#34;,
  632. Action: func(c *Context) error {
  633. fmt.Printf(&#34;the next example&#34;)
  634. return nil
  635. },
  636. },
  637. }
  638. app.Run(os.Args)
  639. <span class="comment"></pre>
  640. <p>Output:</p>
  641. <pre class="output">describeit
  642. d
  643. next
  644. help
  645. h
  646. </pre>
  647. </div>
  648. </div>
  649. <div id="example_App_Run_help" class="toggle">
  650. <div class="collapsed">
  651. <p class="exampleHeading toggleButton"><span class="text">Example (Help)</span></p>
  652. </div>
  653. <div class="expanded">
  654. <p class="exampleHeading toggleButton"><span class="text">Example (Help)</span></p>
  655. <p>Code:</p>
  656. <pre class="code"><span class="comment">// set args for examples sake</span>
  657. os.Args = []string{&#34;greet&#34;, &#34;h&#34;, &#34;describeit&#34;}
  658. app := NewApp()
  659. app.Name = &#34;greet&#34;
  660. app.Flags = []Flag{
  661. StringFlag{Name: &#34;name&#34;, Value: &#34;bob&#34;, Usage: &#34;a name to say&#34;},
  662. }
  663. app.Commands = []Command{
  664. {
  665. Name: &#34;describeit&#34;,
  666. Aliases: []string{&#34;d&#34;},
  667. Usage: &#34;use it to see a description&#34;,
  668. Description: &#34;This is how we describe describeit the function&#34;,
  669. Action: func(c *Context) error {
  670. fmt.Printf(&#34;i like to describe things&#34;)
  671. return nil
  672. },
  673. },
  674. }
  675. app.Run(os.Args)
  676. <span class="comment"></pre>
  677. <p>Output:</p>
  678. <pre class="output">NAME:
  679. greet describeit - use it to see a description
  680. USAGE:
  681. greet describeit [arguments...]
  682. DESCRIPTION:
  683. This is how we describe describeit the function
  684. </pre>
  685. </div>
  686. </div>
  687. <div id="example_App_Run_subcommand" class="toggle">
  688. <div class="collapsed">
  689. <p class="exampleHeading toggleButton"><span class="text">Example (Subcommand)</span></p>
  690. </div>
  691. <div class="expanded">
  692. <p class="exampleHeading toggleButton"><span class="text">Example (Subcommand)</span></p>
  693. <p>Code:</p>
  694. <pre class="code"><span class="comment">// set args for examples sake</span>
  695. os.Args = []string{&#34;say&#34;, &#34;hi&#34;, &#34;english&#34;, &#34;--name&#34;, &#34;Jeremy&#34;}
  696. app := NewApp()
  697. app.Name = &#34;say&#34;
  698. app.Commands = []Command{
  699. {
  700. Name: &#34;hello&#34;,
  701. Aliases: []string{&#34;hi&#34;},
  702. Usage: &#34;use it to see a description&#34;,
  703. Description: &#34;This is how we describe hello the function&#34;,
  704. Subcommands: []Command{
  705. {
  706. Name: &#34;english&#34;,
  707. Aliases: []string{&#34;en&#34;},
  708. Usage: &#34;sends a greeting in english&#34;,
  709. Description: &#34;greets someone in english&#34;,
  710. Flags: []Flag{
  711. StringFlag{
  712. Name: &#34;name&#34;,
  713. Value: &#34;Bob&#34;,
  714. Usage: &#34;Name of the person to greet&#34;,
  715. },
  716. },
  717. Action: func(c *Context) error {
  718. fmt.Println(&#34;Hello,&#34;, c.String(&#34;name&#34;))
  719. return nil
  720. },
  721. },
  722. },
  723. },
  724. }
  725. app.Run(os.Args)
  726. <span class="comment"></pre>
  727. <p>Output:</p>
  728. <pre class="output">Hello, Jeremy
  729. </pre>
  730. </div>
  731. </div>
  732. <h3 id="App.RunAndExitOnError">func (*App) <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=6885:6918#L246">RunAndExitOnError</a></h3>
  733. <pre>func (a *<a href="index.html#App">App</a>) RunAndExitOnError()</pre>
  734. <p>
  735. RunAndExitOnError calls .Run() and exits non-zero if an error was returned
  736. </p>
  737. <p>
  738. Deprecated: instead you should return an error that fulfills cli.ExitCoder
  739. to cli.App.Run. This will cause the application to exit with the given eror
  740. code in the cli.ExitCoder
  741. </p>
  742. <h3 id="App.RunAsSubcommand">func (*App) <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=7133:7188#L255">RunAsSubcommand</a></h3>
  743. <pre>func (a *<a href="index.html#App">App</a>) RunAsSubcommand(ctx *<a href="index.html#Context">Context</a>) (err <a href="../../../builtin/index.html#error">error</a>)</pre>
  744. <p>
  745. RunAsSubcommand invokes the subcommand given the context, parses ctx.Args() to
  746. generate command-specific flags
  747. </p>
  748. <h3 id="App.Setup">func (*App) <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=4129:4150#L114">Setup</a></h3>
  749. <pre>func (a *<a href="index.html#App">App</a>) Setup()</pre>
  750. <p>
  751. Setup runs initialization code to ensure all data structures are ready for
  752. `Run` or inspection prior to `Run`. It is internally called by `Run`, but
  753. will return early if setup has already happened.
  754. </p>
  755. <h3 id="App.VisibleCategories">func (*App) <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=9655:9707#L380">VisibleCategories</a></h3>
  756. <pre>func (a *<a href="index.html#App">App</a>) VisibleCategories() []*<a href="index.html#CommandCategory">CommandCategory</a></pre>
  757. <p>
  758. VisibleCategories returns a slice of categories and commands that are
  759. Hidden=false
  760. </p>
  761. <h3 id="App.VisibleCommands">func (*App) <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=10085:10126#L398">VisibleCommands</a></h3>
  762. <pre>func (a *<a href="index.html#App">App</a>) VisibleCommands() []<a href="index.html#Command">Command</a></pre>
  763. <p>
  764. VisibleCommands returns a slice of the Commands with Hidden=false
  765. </p>
  766. <h3 id="App.VisibleFlags">func (*App) <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=10325:10360#L409">VisibleFlags</a></h3>
  767. <pre>func (a *<a href="index.html#App">App</a>) VisibleFlags() []<a href="index.html#Flag">Flag</a></pre>
  768. <p>
  769. VisibleFlags returns a slice of the Flags with Hidden=false
  770. </p>
  771. <h2 id="Args">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=3817:3835#L141">Args</a></h2>
  772. <pre>type Args []<a href="../../../builtin/index.html#string">string</a></pre>
  773. <p>
  774. Args contains apps console arguments
  775. </p>
  776. <h3 id="Args.First">func (Args) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=4301:4329#L163">First</a></h3>
  777. <pre>func (a <a href="index.html#Args">Args</a>) First() <a href="../../../builtin/index.html#string">string</a></pre>
  778. <p>
  779. First returns the first argument, or else a blank string
  780. </p>
  781. <h3 id="Args.Get">func (Args) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=4159:4190#L155">Get</a></h3>
  782. <pre>func (a <a href="index.html#Args">Args</a>) Get(n <a href="../../../builtin/index.html#int">int</a>) <a href="../../../builtin/index.html#string">string</a></pre>
  783. <p>
  784. Get returns the nth argument, or else a blank string
  785. </p>
  786. <h3 id="Args.Present">func (Args) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=4600:4628#L177">Present</a></h3>
  787. <pre>func (a <a href="index.html#Args">Args</a>) Present() <a href="../../../builtin/index.html#bool">bool</a></pre>
  788. <p>
  789. Present checks if there are any arguments present
  790. </p>
  791. <h3 id="Args.Swap">func (Args) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=4699:4737#L182">Swap</a></h3>
  792. <pre>func (a <a href="index.html#Args">Args</a>) Swap(from, to <a href="../../../builtin/index.html#int">int</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  793. <p>
  794. Swap swaps arguments at the given indexes
  795. </p>
  796. <h3 id="Args.Tail">func (Args) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=4447:4476#L169">Tail</a></h3>
  797. <pre>func (a <a href="index.html#Args">Args</a>) Tail() []<a href="../../../builtin/index.html#string">string</a></pre>
  798. <p>
  799. Tail returns the rest of the arguments (not the first one)
  800. or else an empty string slice
  801. </p>
  802. <h2 id="Author">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=10861:10952#L440">Author</a></h2>
  803. <pre>type Author struct {
  804. Name <a href="../../../builtin/index.html#string">string</a> <span class="comment">// The Authors name</span>
  805. Email <a href="../../../builtin/index.html#string">string</a> <span class="comment">// The Authors email</span>
  806. }</pre>
  807. <p>
  808. Author represents someone who has contributed to a cli project.
  809. </p>
  810. <h3 id="Author.String">func (Author) <a href="http://localhost:6060/src/github.com/codegangsta/cli/app.go?s=11060:11091#L446">String</a></h3>
  811. <pre>func (a <a href="index.html#Author">Author</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  812. <p>
  813. String makes Author comply to the Stringer interface, to allow an easy print in the templating process
  814. </p>
  815. <h2 id="BashCompleteFunc">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/funcs.go?s=94:130#L1">BashCompleteFunc</a></h2>
  816. <pre>type BashCompleteFunc func(*<a href="index.html#Context">Context</a>)</pre>
  817. <p>
  818. BashCompleteFunc is an action to execute when the bash-completion flag is set
  819. </p>
  820. <h2 id="BeforeFunc">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/funcs.go?s=291:327#L1">BeforeFunc</a></h2>
  821. <pre>type BeforeFunc func(*<a href="index.html#Context">Context</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  822. <p>
  823. BeforeFunc is an action to execute before any subcommands are run, but after
  824. the context is ready if a non-nil error is returned, no subcommands are run
  825. </p>
  826. <h2 id="BoolFlag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=126:247#L2">BoolFlag</a></h2>
  827. <pre>type BoolFlag struct {
  828. Name <a href="../../../builtin/index.html#string">string</a>
  829. Usage <a href="../../../builtin/index.html#string">string</a>
  830. EnvVar <a href="../../../builtin/index.html#string">string</a>
  831. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  832. Destination *<a href="../../../builtin/index.html#bool">bool</a>
  833. }</pre>
  834. <p>
  835. BoolFlag is a flag with type bool
  836. </p>
  837. <h3 id="BoolFlag.Apply">func (BoolFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=5691:5733#L229">Apply</a></h3>
  838. <pre>func (f <a href="index.html#BoolFlag">BoolFlag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  839. <p>
  840. Apply populates the flag given the flag set and environment
  841. </p>
  842. <h3 id="BoolFlag.GetName">func (BoolFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=434:468#L17">GetName</a></h3>
  843. <pre>func (f <a href="index.html#BoolFlag">BoolFlag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  844. <p>
  845. GetName returns the name of the flag
  846. </p>
  847. <h3 id="BoolFlag.String">func (BoolFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=331:364#L12">String</a></h3>
  848. <pre>func (f <a href="index.html#BoolFlag">BoolFlag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  849. <p>
  850. String returns a readable representation of this value
  851. (for usage defaults)
  852. </p>
  853. <h2 id="BoolTFlag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=1167:1289#L49">BoolTFlag</a></h2>
  854. <pre>type BoolTFlag struct {
  855. Name <a href="../../../builtin/index.html#string">string</a>
  856. Usage <a href="../../../builtin/index.html#string">string</a>
  857. EnvVar <a href="../../../builtin/index.html#string">string</a>
  858. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  859. Destination *<a href="../../../builtin/index.html#bool">bool</a>
  860. }</pre>
  861. <p>
  862. BoolTFlag is a flag with type bool that is true by default
  863. </p>
  864. <h3 id="BoolTFlag.Apply">func (BoolTFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=6266:6309#L254">Apply</a></h3>
  865. <pre>func (f <a href="index.html#BoolTFlag">BoolTFlag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  866. <p>
  867. Apply populates the flag given the flag set and environment
  868. </p>
  869. <h3 id="BoolTFlag.GetName">func (BoolTFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=1477:1512#L64">GetName</a></h3>
  870. <pre>func (f <a href="index.html#BoolTFlag">BoolTFlag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  871. <p>
  872. GetName returns the name of the flag
  873. </p>
  874. <h3 id="BoolTFlag.String">func (BoolTFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=1373:1407#L59">String</a></h3>
  875. <pre>func (f <a href="index.html#BoolTFlag">BoolTFlag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  876. <p>
  877. String returns a readable representation of this value
  878. (for usage defaults)
  879. </p>
  880. <h2 id="Command">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/command.go?s=106:2115#L1">Command</a></h2>
  881. <pre>type Command struct {
  882. <span class="comment">// The name of the command</span>
  883. Name <a href="../../../builtin/index.html#string">string</a>
  884. <span class="comment">// short name of the command. Typically one character (deprecated, use `Aliases`)</span>
  885. ShortName <a href="../../../builtin/index.html#string">string</a>
  886. <span class="comment">// A list of aliases for the command</span>
  887. Aliases []<a href="../../../builtin/index.html#string">string</a>
  888. <span class="comment">// A short description of the usage of this command</span>
  889. Usage <a href="../../../builtin/index.html#string">string</a>
  890. <span class="comment">// Custom text to show on USAGE section of help</span>
  891. UsageText <a href="../../../builtin/index.html#string">string</a>
  892. <span class="comment">// A longer explanation of how the command works</span>
  893. Description <a href="../../../builtin/index.html#string">string</a>
  894. <span class="comment">// A short description of the arguments of this command</span>
  895. ArgsUsage <a href="../../../builtin/index.html#string">string</a>
  896. <span class="comment">// The category the command is part of</span>
  897. Category <a href="../../../builtin/index.html#string">string</a>
  898. <span class="comment">// The function to call when checking for bash command completions</span>
  899. BashComplete <a href="index.html#BashCompleteFunc">BashCompleteFunc</a>
  900. <span class="comment">// An action to execute before any sub-subcommands are run, but after the context is ready</span>
  901. <span class="comment">// If a non-nil error is returned, no sub-subcommands are run</span>
  902. Before <a href="index.html#BeforeFunc">BeforeFunc</a>
  903. <span class="comment">// An action to execute after any subcommands are run, but after the subcommand has finished</span>
  904. <span class="comment">// It is run even if Action() panics</span>
  905. After <a href="index.html#AfterFunc">AfterFunc</a>
  906. <span class="comment">// The function to call when this command is invoked</span>
  907. Action interface{}
  908. <span class="comment">// Execute this function if a usage error occurs.</span>
  909. OnUsageError <a href="index.html#OnUsageErrorFunc">OnUsageErrorFunc</a>
  910. <span class="comment">// List of child commands</span>
  911. Subcommands <a href="index.html#Commands">Commands</a>
  912. <span class="comment">// List of flags to parse</span>
  913. Flags []<a href="index.html#Flag">Flag</a>
  914. <span class="comment">// Treat all flags as normal arguments if true</span>
  915. SkipFlagParsing <a href="../../../builtin/index.html#bool">bool</a>
  916. <span class="comment">// Skip argument reordering which attempts to move flags before arguments,</span>
  917. <span class="comment">// but only works if all flags appear after all arguments. This behavior was</span>
  918. <span class="comment">// removed n version 2 since it only works under specific conditions so we</span>
  919. <span class="comment">// backport here by exposing it as an option for compatibility.</span>
  920. SkipArgReorder <a href="../../../builtin/index.html#bool">bool</a>
  921. <span class="comment">// Boolean to hide built-in help command</span>
  922. HideHelp <a href="../../../builtin/index.html#bool">bool</a>
  923. <span class="comment">// Boolean to hide this command from help or completion</span>
  924. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  925. <span class="comment">// Full name of command for help, defaults to full command name, including parent commands.</span>
  926. HelpName <a href="../../../builtin/index.html#string">string</a>
  927. <span class="comment">// contains filtered or unexported fields</span>
  928. }</pre>
  929. <p>
  930. Command is a subcommand for a cli.App.
  931. </p>
  932. <h3 id="Command.FullName">func (Command) <a href="http://localhost:6060/src/github.com/codegangsta/cli/command.go?s=2249:2283#L56">FullName</a></h3>
  933. <pre>func (c <a href="index.html#Command">Command</a>) FullName() <a href="../../../builtin/index.html#string">string</a></pre>
  934. <p>
  935. FullName returns the full name of the command.
  936. For subcommands this ensures that parent commands are part of the command path
  937. </p>
  938. <h3 id="Command.HasName">func (Command) <a href="http://localhost:6060/src/github.com/codegangsta/cli/command.go?s=5398:5440#L201">HasName</a></h3>
  939. <pre>func (c <a href="index.html#Command">Command</a>) HasName(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#bool">bool</a></pre>
  940. <p>
  941. HasName returns true if Command.Name or Command.ShortName matches given name
  942. </p>
  943. <h3 id="Command.Names">func (Command) <a href="http://localhost:6060/src/github.com/codegangsta/cli/command.go?s=5150:5183#L190">Names</a></h3>
  944. <pre>func (c <a href="index.html#Command">Command</a>) Names() []<a href="../../../builtin/index.html#string">string</a></pre>
  945. <p>
  946. Names returns the names including short names and aliases.
  947. </p>
  948. <h3 id="Command.Run">func (Command) <a href="http://localhost:6060/src/github.com/codegangsta/cli/command.go?s=2542:2588#L67">Run</a></h3>
  949. <pre>func (c <a href="index.html#Command">Command</a>) Run(ctx *<a href="index.html#Context">Context</a>) (err <a href="../../../builtin/index.html#error">error</a>)</pre>
  950. <p>
  951. Run invokes the command given the context, parses ctx.Args() to generate command-specific flags
  952. </p>
  953. <h3 id="Command.VisibleFlags">func (Command) <a href="http://localhost:6060/src/github.com/codegangsta/cli/command.go?s=6959:6997#L272">VisibleFlags</a></h3>
  954. <pre>func (c <a href="index.html#Command">Command</a>) VisibleFlags() []<a href="index.html#Flag">Flag</a></pre>
  955. <p>
  956. VisibleFlags returns a slice of the Flags with Hidden=false
  957. </p>
  958. <h2 id="CommandCategories">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/category.go?s=66:107#L1">CommandCategories</a></h2>
  959. <pre>type CommandCategories []*<a href="index.html#CommandCategory">CommandCategory</a></pre>
  960. <p>
  961. CommandCategories is a slice of *CommandCategory.
  962. </p>
  963. <h3 id="CommandCategories.AddCommand">func (CommandCategories) <a href="http://localhost:6060/src/github.com/codegangsta/cli/category.go?s=487:576#L15">AddCommand</a></h3>
  964. <pre>func (c <a href="index.html#CommandCategories">CommandCategories</a>) AddCommand(category <a href="../../../builtin/index.html#string">string</a>, command <a href="index.html#Command">Command</a>) <a href="index.html#CommandCategories">CommandCategories</a></pre>
  965. <p>
  966. AddCommand adds a command to a category.
  967. </p>
  968. <h3 id="CommandCategories.Len">func (CommandCategories) <a href="http://localhost:6060/src/github.com/codegangsta/cli/category.go?s=314:350#L6">Len</a></h3>
  969. <pre>func (c <a href="index.html#CommandCategories">CommandCategories</a>) Len() <a href="../../../builtin/index.html#int">int</a></pre>
  970. <h3 id="CommandCategories.Less">func (CommandCategories) <a href="http://localhost:6060/src/github.com/codegangsta/cli/category.go?s=232:278#L2">Less</a></h3>
  971. <pre>func (c <a href="index.html#CommandCategories">CommandCategories</a>) Less(i, j <a href="../../../builtin/index.html#int">int</a>) <a href="../../../builtin/index.html#bool">bool</a></pre>
  972. <h3 id="CommandCategories.Swap">func (CommandCategories) <a href="http://localhost:6060/src/github.com/codegangsta/cli/category.go?s=371:412#L10">Swap</a></h3>
  973. <pre>func (c <a href="index.html#CommandCategories">CommandCategories</a>) Swap(i, j <a href="../../../builtin/index.html#int">int</a>)</pre>
  974. <h2 id="CommandCategory">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/category.go?s=163:230#L1">CommandCategory</a></h2>
  975. <pre>type CommandCategory struct {
  976. Name <a href="../../../builtin/index.html#string">string</a>
  977. Commands <a href="index.html#Commands">Commands</a>
  978. }</pre>
  979. <p>
  980. CommandCategory is a category containing commands.
  981. </p>
  982. <h3 id="CommandCategory.VisibleCommands">func (*CommandCategory) <a href="http://localhost:6060/src/github.com/codegangsta/cli/category.go?s=901:954#L26">VisibleCommands</a></h3>
  983. <pre>func (c *<a href="index.html#CommandCategory">CommandCategory</a>) VisibleCommands() []<a href="index.html#Command">Command</a></pre>
  984. <p>
  985. VisibleCommands returns a slice of the Commands with Hidden=false
  986. </p>
  987. <h2 id="CommandNotFoundFunc">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/funcs.go?s=693:740#L8">CommandNotFoundFunc</a></h2>
  988. <pre>type CommandNotFoundFunc func(*<a href="index.html#Context">Context</a>, <a href="../../../builtin/index.html#string">string</a>)</pre>
  989. <p>
  990. CommandNotFoundFunc is executed if the proper command cannot be found
  991. </p>
  992. <h2 id="Commands">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/command.go?s=2418:2441#L64">Commands</a></h2>
  993. <pre>type Commands []<a href="index.html#Command">Command</a></pre>
  994. <p>
  995. Commands is a slice of Command
  996. </p>
  997. <h2 id="Context">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=256:406#L5">Context</a></h2>
  998. <pre>type Context struct {
  999. App *<a href="index.html#App">App</a>
  1000. Command <a href="index.html#Command">Command</a>
  1001. <span class="comment">// contains filtered or unexported fields</span>
  1002. }</pre>
  1003. <p>
  1004. Context is a type that is passed through to
  1005. each Handler action in a cli application. Context
  1006. can be used to retrieve context-specific Args and
  1007. parsed command-line options.
  1008. </p>
  1009. <h3 id="NewContext">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=496:569#L14">NewContext</a></h3>
  1010. <pre>func NewContext(app *<a href="index.html#App">App</a>, set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>, parentCtx *<a href="index.html#Context">Context</a>) *<a href="index.html#Context">Context</a></pre>
  1011. <p>
  1012. NewContext creates a new context. For use in when invoking an App or Command action.
  1013. </p>
  1014. <h3 id="Context.Args">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=3909:3938#L144">Args</a></h3>
  1015. <pre>func (c *<a href="index.html#Context">Context</a>) Args() <a href="index.html#Args">Args</a></pre>
  1016. <p>
  1017. Args returns the command line arguments associated with the context.
  1018. </p>
  1019. <h3 id="Context.Bool">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=567:607#L23">Bool</a></h3>
  1020. <pre>func (c *<a href="index.html#Context">Context</a>) Bool(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#bool">bool</a></pre>
  1021. <p>
  1022. Bool looks up the value of a local BoolFlag, returns
  1023. false if not found
  1024. </p>
  1025. <h3 id="Context.BoolT">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=1613:1654#L70">BoolT</a></h3>
  1026. <pre>func (c *<a href="index.html#Context">Context</a>) BoolT(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#bool">bool</a></pre>
  1027. <p>
  1028. BoolT looks up the value of a local BoolTFlag, returns
  1029. false if not found
  1030. </p>
  1031. <h3 id="Context.Duration">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=2750:2803#L118">Duration</a></h3>
  1032. <pre>func (c *<a href="index.html#Context">Context</a>) Duration(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../time/index.html">time</a>.<a href="../../../time/index.html#Duration">Duration</a></pre>
  1033. <p>
  1034. Duration looks up the value of a local DurationFlag, returns
  1035. 0 if not found
  1036. </p>
  1037. <h3 id="Context.FlagNames">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=3133:3179#L112">FlagNames</a></h3>
  1038. <pre>func (c *<a href="index.html#Context">Context</a>) FlagNames() (names []<a href="../../../builtin/index.html#string">string</a>)</pre>
  1039. <p>
  1040. FlagNames returns a slice of flag names used in this context.
  1041. </p>
  1042. <h3 id="Context.Float64">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=3847:3893#L166">Float64</a></h3>
  1043. <pre>func (c *<a href="index.html#Context">Context</a>) Float64(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#float64">float64</a></pre>
  1044. <p>
  1045. Float64 looks up the value of a local Float64Flag, returns
  1046. 0 if not found
  1047. </p>
  1048. <h3 id="Context.Generic">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=4878:4928#L213">Generic</a></h3>
  1049. <pre>func (c *<a href="index.html#Context">Context</a>) Generic(name <a href="../../../builtin/index.html#string">string</a>) interface{}</pre>
  1050. <p>
  1051. Generic looks up the value of a local GenericFlag, returns
  1052. nil if not found
  1053. </p>
  1054. <h3 id="Context.GlobalBool">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=734:780#L29">GlobalBool</a></h3>
  1055. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalBool(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#bool">bool</a></pre>
  1056. <p>
  1057. GlobalBool looks up the value of a global BoolFlag, returns
  1058. false if not found
  1059. </p>
  1060. <h3 id="Context.GlobalBoolT">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=1784:1831#L76">GlobalBoolT</a></h3>
  1061. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalBoolT(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#bool">bool</a></pre>
  1062. <p>
  1063. GlobalBoolT looks up the value of a global BoolTFlag, returns
  1064. false if not found
  1065. </p>
  1066. <h3 id="Context.GlobalDuration">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=2938:2997#L124">GlobalDuration</a></h3>
  1067. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalDuration(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../time/index.html">time</a>.<a href="../../../time/index.html#Duration">Duration</a></pre>
  1068. <p>
  1069. GlobalDuration looks up the value of a global DurationFlag, returns
  1070. 0 if not found
  1071. </p>
  1072. <h3 id="Context.GlobalFlagNames">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=3425:3477#L124">GlobalFlagNames</a></h3>
  1073. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalFlagNames() (names []<a href="../../../builtin/index.html#string">string</a>)</pre>
  1074. <p>
  1075. GlobalFlagNames returns a slice of global flag names used by the app.
  1076. </p>
  1077. <h3 id="Context.GlobalFloat64">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=4025:4077#L172">GlobalFloat64</a></h3>
  1078. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalFloat64(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#float64">float64</a></pre>
  1079. <p>
  1080. GlobalFloat64 looks up the value of a global Float64Flag, returns
  1081. 0 if not found
  1082. </p>
  1083. <h3 id="Context.GlobalGeneric">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=5062:5118#L219">GlobalGeneric</a></h3>
  1084. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalGeneric(name <a href="../../../builtin/index.html#string">string</a>) interface{}</pre>
  1085. <p>
  1086. GlobalGeneric looks up the value of a global GenericFlag, returns
  1087. nil if not found
  1088. </p>
  1089. <h3 id="Context.GlobalInt">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=7114:7158#L315">GlobalInt</a></h3>
  1090. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalInt(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#int">int</a></pre>
  1091. <p>
  1092. GlobalInt looks up the value of a global IntFlag, returns
  1093. 0 if not found
  1094. </p>
  1095. <h3 id="Context.GlobalInt64">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=6103:6151#L267">GlobalInt64</a></h3>
  1096. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalInt64(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#int64">int64</a></pre>
  1097. <p>
  1098. GlobalInt64 looks up the value of a global Int64Flag, returns
  1099. 0 if not found
  1100. </p>
  1101. <h3 id="Context.GlobalInt64Slice">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=9222:9277#L409">GlobalInt64Slice</a></h3>
  1102. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalInt64Slice(name <a href="../../../builtin/index.html#string">string</a>) []<a href="../../../builtin/index.html#int64">int64</a></pre>
  1103. <p>
  1104. GlobalInt64Slice looks up the value of a global Int64SliceFlag, returns
  1105. nil if not found
  1106. </p>
  1107. <h3 id="Context.GlobalIntSlice">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=8145:8196#L362">GlobalIntSlice</a></h3>
  1108. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalIntSlice(name <a href="../../../builtin/index.html#string">string</a>) []<a href="../../../builtin/index.html#int">int</a></pre>
  1109. <p>
  1110. GlobalIntSlice looks up the value of a global IntSliceFlag, returns
  1111. nil if not found
  1112. </p>
  1113. <h3 id="Context.GlobalIsSet">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=2840:2887#L97">GlobalIsSet</a></h3>
  1114. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalIsSet(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#bool">bool</a></pre>
  1115. <p>
  1116. GlobalIsSet determines if the global flag was actually set
  1117. </p>
  1118. <h3 id="Context.GlobalSet">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=943:996#L29">GlobalSet</a></h3>
  1119. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalSet(name, value <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  1120. <p>
  1121. GlobalSet sets a context flag to a value on the global flagset
  1122. </p>
  1123. <h3 id="Context.GlobalString">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=10304:10354#L457">GlobalString</a></h3>
  1124. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalString(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#string">string</a></pre>
  1125. <p>
  1126. GlobalString looks up the value of a global StringFlag, returns
  1127. &#34;&#34; if not found
  1128. </p>
  1129. <h3 id="Context.GlobalStringSlice">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=11374:11431#L504">GlobalStringSlice</a></h3>
  1130. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalStringSlice(name <a href="../../../builtin/index.html#string">string</a>) []<a href="../../../builtin/index.html#string">string</a></pre>
  1131. <p>
  1132. GlobalStringSlice looks up the value of a global StringSliceFlag, returns
  1133. nil if not found
  1134. </p>
  1135. <h3 id="Context.GlobalUint">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=13491:13537#L600">GlobalUint</a></h3>
  1136. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalUint(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#uint">uint</a></pre>
  1137. <p>
  1138. GlobalUint looks up the value of a global UintFlag, returns
  1139. 0 if not found
  1140. </p>
  1141. <h3 id="Context.GlobalUint64">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=12460:12510#L552">GlobalUint64</a></h3>
  1142. <pre>func (c *<a href="index.html#Context">Context</a>) GlobalUint64(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#uint64">uint64</a></pre>
  1143. <p>
  1144. GlobalUint64 looks up the value of a global Uint64Flag, returns
  1145. 0 if not found
  1146. </p>
  1147. <h3 id="Context.Int">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=6956:6994#L309">Int</a></h3>
  1148. <pre>func (c *<a href="index.html#Context">Context</a>) Int(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#int">int</a></pre>
  1149. <p>
  1150. Int looks up the value of a local IntFlag, returns
  1151. 0 if not found
  1152. </p>
  1153. <h3 id="Context.Int64">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=5935:5977#L261">Int64</a></h3>
  1154. <pre>func (c *<a href="index.html#Context">Context</a>) Int64(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#int64">int64</a></pre>
  1155. <p>
  1156. Int64 looks up the value of a local Int64Flag, returns
  1157. 0 if not found
  1158. </p>
  1159. <h3 id="Context.Int64Slice">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=9030:9079#L403">Int64Slice</a></h3>
  1160. <pre>func (c *<a href="index.html#Context">Context</a>) Int64Slice(name <a href="../../../builtin/index.html#string">string</a>) []<a href="../../../builtin/index.html#int64">int64</a></pre>
  1161. <p>
  1162. Int64Slice looks up the value of a local Int64SliceFlag, returns
  1163. nil if not found
  1164. </p>
  1165. <h3 id="Context.IntSlice">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=7963:8008#L356">IntSlice</a></h3>
  1166. <pre>func (c *<a href="index.html#Context">Context</a>) IntSlice(name <a href="../../../builtin/index.html#string">string</a>) []<a href="../../../builtin/index.html#int">int</a></pre>
  1167. <p>
  1168. IntSlice looks up the value of a local IntSliceFlag, returns
  1169. nil if not found
  1170. </p>
  1171. <h3 id="Context.IsSet">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=1101:1142#L34">IsSet</a></h3>
  1172. <pre>func (c *<a href="index.html#Context">Context</a>) IsSet(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#bool">bool</a></pre>
  1173. <p>
  1174. IsSet determines if the flag was actually set
  1175. </p>
  1176. <h3 id="Context.NArg">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=4047:4075#L150">NArg</a></h3>
  1177. <pre>func (c *<a href="index.html#Context">Context</a>) NArg() <a href="../../../builtin/index.html#int">int</a></pre>
  1178. <p>
  1179. NArg returns the number of the command line arguments.
  1180. </p>
  1181. <h3 id="Context.NumFlags">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=686:718#L19">NumFlags</a></h3>
  1182. <pre>func (c *<a href="index.html#Context">Context</a>) NumFlags() <a href="../../../builtin/index.html#int">int</a></pre>
  1183. <p>
  1184. NumFlags returns the number of flags set
  1185. </p>
  1186. <h3 id="Context.Parent">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=3712:3747#L136">Parent</a></h3>
  1187. <pre>func (c *<a href="index.html#Context">Context</a>) Parent() *<a href="index.html#Context">Context</a></pre>
  1188. <p>
  1189. Parent returns the parent context, if any
  1190. </p>
  1191. <h3 id="Context.Set">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/context.go?s=789:836#L24">Set</a></h3>
  1192. <pre>func (c *<a href="index.html#Context">Context</a>) Set(name, value <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  1193. <p>
  1194. Set sets a context flag to a value.
  1195. </p>
  1196. <h3 id="Context.String">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=10130:10174#L451">String</a></h3>
  1197. <pre>func (c *<a href="index.html#Context">Context</a>) String(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#string">string</a></pre>
  1198. <p>
  1199. String looks up the value of a local StringFlag, returns
  1200. &#34;&#34; if not found
  1201. </p>
  1202. <h3 id="Context.StringSlice">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=11177:11228#L498">StringSlice</a></h3>
  1203. <pre>func (c *<a href="index.html#Context">Context</a>) StringSlice(name <a href="../../../builtin/index.html#string">string</a>) []<a href="../../../builtin/index.html#string">string</a></pre>
  1204. <p>
  1205. StringSlice looks up the value of a local StringSliceFlag, returns
  1206. nil if not found
  1207. </p>
  1208. <h3 id="Context.Uint">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=13328:13368#L594">Uint</a></h3>
  1209. <pre>func (c *<a href="index.html#Context">Context</a>) Uint(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#uint">uint</a></pre>
  1210. <p>
  1211. Uint looks up the value of a local UintFlag, returns
  1212. 0 if not found
  1213. </p>
  1214. <h3 id="Context.Uint64">func (*Context) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=12287:12331#L546">Uint64</a></h3>
  1215. <pre>func (c *<a href="index.html#Context">Context</a>) Uint64(name <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#uint64">uint64</a></pre>
  1216. <p>
  1217. Uint64 looks up the value of a local Uint64Flag, returns
  1218. 0 if not found
  1219. </p>
  1220. <h2 id="DurationFlag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=2257:2418#L96">DurationFlag</a></h2>
  1221. <pre>type DurationFlag struct {
  1222. Name <a href="../../../builtin/index.html#string">string</a>
  1223. Usage <a href="../../../builtin/index.html#string">string</a>
  1224. EnvVar <a href="../../../builtin/index.html#string">string</a>
  1225. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  1226. Value <a href="../../../time/index.html">time</a>.<a href="../../../time/index.html#Duration">Duration</a>
  1227. Destination *<a href="../../../time/index.html">time</a>.<a href="../../../time/index.html#Duration">Duration</a>
  1228. }</pre>
  1229. <p>
  1230. DurationFlag is a flag with type time.Duration (see <a href="https://golang.org/pkg/time/#ParseDuration">https://golang.org/pkg/time/#ParseDuration</a>)
  1231. </p>
  1232. <h3 id="DurationFlag.Apply">func (DurationFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=9680:9726#L396">Apply</a></h3>
  1233. <pre>func (f <a href="index.html#DurationFlag">DurationFlag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  1234. <p>
  1235. Apply populates the flag given the flag set and environment
  1236. </p>
  1237. <h3 id="DurationFlag.GetName">func (DurationFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=2609:2647#L112">GetName</a></h3>
  1238. <pre>func (f <a href="index.html#DurationFlag">DurationFlag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  1239. <p>
  1240. GetName returns the name of the flag
  1241. </p>
  1242. <h3 id="DurationFlag.String">func (DurationFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=2502:2539#L107">String</a></h3>
  1243. <pre>func (f <a href="index.html#DurationFlag">DurationFlag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1244. <p>
  1245. String returns a readable representation of this value
  1246. (for usage defaults)
  1247. </p>
  1248. <h2 id="ExitCoder">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/errors.go?s=887:938#L29">ExitCoder</a></h2>
  1249. <pre>type ExitCoder interface {
  1250. <a href="../../../builtin/index.html#error">error</a>
  1251. ExitCode() <a href="../../../builtin/index.html#int">int</a>
  1252. }</pre>
  1253. <p>
  1254. ExitCoder is the interface checked by `App` and `Command` for a custom exit
  1255. code
  1256. </p>
  1257. <h2 id="ExitError">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/errors.go?s=1013:1069#L35">ExitError</a></h2>
  1258. <pre>type ExitError struct {
  1259. <span class="comment">// contains filtered or unexported fields</span>
  1260. }</pre>
  1261. <p>
  1262. ExitError fulfills both the builtin `error` interface and `ExitCoder`
  1263. </p>
  1264. <h3 id="NewExitError">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/errors.go?s=1110:1168#L41">NewExitError</a></h3>
  1265. <pre>func NewExitError(message <a href="../../../builtin/index.html#string">string</a>, exitCode <a href="../../../builtin/index.html#int">int</a>) *<a href="index.html#ExitError">ExitError</a></pre>
  1266. <p>
  1267. NewExitError makes a new *ExitError
  1268. </p>
  1269. <h3 id="ExitError.Error">func (*ExitError) <a href="http://localhost:6060/src/github.com/codegangsta/cli/errors.go?s=1325:1360#L50">Error</a></h3>
  1270. <pre>func (ee *<a href="index.html#ExitError">ExitError</a>) Error() <a href="../../../builtin/index.html#string">string</a></pre>
  1271. <p>
  1272. Error returns the string message, fulfilling the interface required by
  1273. `error`
  1274. </p>
  1275. <h3 id="ExitError.ExitCode">func (*ExitError) <a href="http://localhost:6060/src/github.com/codegangsta/cli/errors.go?s=1472:1507#L56">ExitCode</a></h3>
  1276. <pre>func (ee *<a href="index.html#ExitError">ExitError</a>) ExitCode() <a href="../../../builtin/index.html#int">int</a></pre>
  1277. <p>
  1278. ExitCode returns the exit code, fulfilling the interface required by
  1279. `ExitCoder`
  1280. </p>
  1281. <h2 id="Flag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=991:1114#L33">Flag</a></h2>
  1282. <pre>type Flag interface {
  1283. <a href="../../../fmt/index.html">fmt</a>.<a href="../../../fmt/index.html#Stringer">Stringer</a>
  1284. <span class="comment">// Apply Flag settings to the given flag set</span>
  1285. Apply(*<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)
  1286. GetName() <a href="../../../builtin/index.html#string">string</a>
  1287. }</pre>
  1288. <p>
  1289. Flag is a common interface related to parsing flags in cli.
  1290. For more advanced flag parsing techniques, it is recommended that
  1291. this interface be implemented.
  1292. </p>
  1293. <h2 id="FlagStringFunc">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/funcs.go?s=1226:1263#L18">FlagStringFunc</a></h2>
  1294. <pre>type FlagStringFunc func(<a href="index.html#Flag">Flag</a>) <a href="../../../builtin/index.html#string">string</a></pre>
  1295. <p>
  1296. FlagStringFunc is used by the help generation to display a flag, which is
  1297. expected to be a single line.
  1298. </p>
  1299. <pre>var <span id="FlagStringer">FlagStringer</span> <a href="index.html#FlagStringFunc">FlagStringFunc</a> = stringifyFlag</pre>
  1300. <p>
  1301. FlagStringer converts a flag definition to a string. This is used by help
  1302. to display a flag.
  1303. </p>
  1304. <h2 id="Float64Flag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=3371:3519#L144">Float64Flag</a></h2>
  1305. <pre>type Float64Flag struct {
  1306. Name <a href="../../../builtin/index.html#string">string</a>
  1307. Usage <a href="../../../builtin/index.html#string">string</a>
  1308. EnvVar <a href="../../../builtin/index.html#string">string</a>
  1309. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  1310. Value <a href="../../../builtin/index.html#float64">float64</a>
  1311. Destination *<a href="../../../builtin/index.html#float64">float64</a>
  1312. }</pre>
  1313. <p>
  1314. Float64Flag is a flag with type float64
  1315. </p>
  1316. <h3 id="Float64Flag.Apply">func (Float64Flag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=10275:10320#L420">Apply</a></h3>
  1317. <pre>func (f <a href="index.html#Float64Flag">Float64Flag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  1318. <p>
  1319. Apply populates the flag given the flag set and environment
  1320. </p>
  1321. <h3 id="Float64Flag.GetName">func (Float64Flag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=3709:3746#L160">GetName</a></h3>
  1322. <pre>func (f <a href="index.html#Float64Flag">Float64Flag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  1323. <p>
  1324. GetName returns the name of the flag
  1325. </p>
  1326. <h3 id="Float64Flag.String">func (Float64Flag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=3603:3639#L155">String</a></h3>
  1327. <pre>func (f <a href="index.html#Float64Flag">Float64Flag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1328. <p>
  1329. String returns a readable representation of this value
  1330. (for usage defaults)
  1331. </p>
  1332. <h2 id="Generic">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=1523:1591#L58">Generic</a></h2>
  1333. <pre>type Generic interface {
  1334. Set(value <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#error">error</a>
  1335. String() <a href="../../../builtin/index.html#string">string</a>
  1336. }</pre>
  1337. <p>
  1338. Generic is a generic parseable type identified by a specific flag
  1339. </p>
  1340. <h2 id="GenericFlag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=4447:4548#L192">GenericFlag</a></h2>
  1341. <pre>type GenericFlag struct {
  1342. Name <a href="../../../builtin/index.html#string">string</a>
  1343. Usage <a href="../../../builtin/index.html#string">string</a>
  1344. EnvVar <a href="../../../builtin/index.html#string">string</a>
  1345. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  1346. Value <a href="index.html#Generic">Generic</a>
  1347. }</pre>
  1348. <p>
  1349. GenericFlag is a flag with type Generic
  1350. </p>
  1351. <h3 id="GenericFlag.Apply">func (GenericFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=1717:1762#L65">Apply</a></h3>
  1352. <pre>func (f <a href="index.html#GenericFlag">GenericFlag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  1353. <p>
  1354. Apply takes the flagset and calls Set on the generic flag with the value
  1355. provided by the user for parsing by the flag
  1356. </p>
  1357. <h3 id="GenericFlag.GetName">func (GenericFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=4738:4775#L207">GetName</a></h3>
  1358. <pre>func (f <a href="index.html#GenericFlag">GenericFlag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  1359. <p>
  1360. GetName returns the name of the flag
  1361. </p>
  1362. <h3 id="GenericFlag.String">func (GenericFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=4632:4668#L202">String</a></h3>
  1363. <pre>func (f <a href="index.html#GenericFlag">GenericFlag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1364. <p>
  1365. String returns a readable representation of this value
  1366. (for usage defaults)
  1367. </p>
  1368. <h2 id="Int64Flag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=5473:5615#L239">Int64Flag</a></h2>
  1369. <pre>type Int64Flag struct {
  1370. Name <a href="../../../builtin/index.html#string">string</a>
  1371. Usage <a href="../../../builtin/index.html#string">string</a>
  1372. EnvVar <a href="../../../builtin/index.html#string">string</a>
  1373. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  1374. Value <a href="../../../builtin/index.html#int64">int64</a>
  1375. Destination *<a href="../../../builtin/index.html#int64">int64</a>
  1376. }</pre>
  1377. <p>
  1378. Int64Flag is a flag with type int64
  1379. </p>
  1380. <h3 id="Int64Flag.Apply">func (Int64Flag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=7921:7964#L324">Apply</a></h3>
  1381. <pre>func (f <a href="index.html#Int64Flag">Int64Flag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  1382. <p>
  1383. Apply populates the flag given the flag set and environment
  1384. </p>
  1385. <h3 id="Int64Flag.GetName">func (Int64Flag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=5803:5838#L255">GetName</a></h3>
  1386. <pre>func (f <a href="index.html#Int64Flag">Int64Flag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  1387. <p>
  1388. GetName returns the name of the flag
  1389. </p>
  1390. <h3 id="Int64Flag.String">func (Int64Flag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=5699:5733#L250">String</a></h3>
  1391. <pre>func (f <a href="index.html#Int64Flag">Int64Flag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1392. <p>
  1393. String returns a readable representation of this value
  1394. (for usage defaults)
  1395. </p>
  1396. <h2 id="Int64Slice">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=4441:4464#L178">Int64Slice</a></h2>
  1397. <pre>type Int64Slice []<a href="../../../builtin/index.html#int64">int64</a></pre>
  1398. <p>
  1399. Int64Slice is an opaque type for []int to satisfy flag.Value
  1400. </p>
  1401. <h3 id="Int64Slice.Set">func (*Int64Slice) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=4543:4587#L181">Set</a></h3>
  1402. <pre>func (f *<a href="index.html#Int64Slice">Int64Slice</a>) Set(value <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  1403. <p>
  1404. Set parses the value into an integer and appends it to the list of values
  1405. </p>
  1406. <h3 id="Int64Slice.String">func (*Int64Slice) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=4784:4820#L191">String</a></h3>
  1407. <pre>func (f *<a href="index.html#Int64Slice">Int64Slice</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1408. <p>
  1409. String returns a readable representation of this value (for usage defaults)
  1410. </p>
  1411. <h3 id="Int64Slice.Value">func (*Int64Slice) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=4909:4945#L196">Value</a></h3>
  1412. <pre>func (f *<a href="index.html#Int64Slice">Int64Slice</a>) Value() []<a href="../../../builtin/index.html#int64">int64</a></pre>
  1413. <p>
  1414. Value returns the slice of ints set by this flag
  1415. </p>
  1416. <h2 id="Int64SliceFlag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=8580:8688#L382">Int64SliceFlag</a></h2>
  1417. <pre>type Int64SliceFlag struct {
  1418. Name <a href="../../../builtin/index.html#string">string</a>
  1419. Usage <a href="../../../builtin/index.html#string">string</a>
  1420. EnvVar <a href="../../../builtin/index.html#string">string</a>
  1421. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  1422. Value *<a href="index.html#Int64Slice">Int64Slice</a>
  1423. }</pre>
  1424. <p>
  1425. Int64SliceFlag is a flag with type *Int64Slice
  1426. </p>
  1427. <h3 id="Int64SliceFlag.Apply">func (Int64SliceFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=5025:5073#L201">Apply</a></h3>
  1428. <pre>func (f <a href="index.html#Int64SliceFlag">Int64SliceFlag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  1429. <p>
  1430. Apply populates the flag given the flag set and environment
  1431. </p>
  1432. <h3 id="Int64SliceFlag.GetName">func (Int64SliceFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=8881:8921#L397">GetName</a></h3>
  1433. <pre>func (f <a href="index.html#Int64SliceFlag">Int64SliceFlag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  1434. <p>
  1435. GetName returns the name of the flag
  1436. </p>
  1437. <h3 id="Int64SliceFlag.String">func (Int64SliceFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=8772:8811#L392">String</a></h3>
  1438. <pre>func (f <a href="index.html#Int64SliceFlag">Int64SliceFlag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1439. <p>
  1440. String returns a readable representation of this value
  1441. (for usage defaults)
  1442. </p>
  1443. <h2 id="IntFlag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=6508:6644#L287">IntFlag</a></h2>
  1444. <pre>type IntFlag struct {
  1445. Name <a href="../../../builtin/index.html#string">string</a>
  1446. Usage <a href="../../../builtin/index.html#string">string</a>
  1447. EnvVar <a href="../../../builtin/index.html#string">string</a>
  1448. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  1449. Value <a href="../../../builtin/index.html#int">int</a>
  1450. Destination *<a href="../../../builtin/index.html#int">int</a>
  1451. }</pre>
  1452. <p>
  1453. IntFlag is a flag with type int
  1454. </p>
  1455. <h3 id="IntFlag.Apply">func (IntFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=7341:7382#L300">Apply</a></h3>
  1456. <pre>func (f <a href="index.html#IntFlag">IntFlag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  1457. <p>
  1458. Apply populates the flag given the flag set and environment
  1459. </p>
  1460. <h3 id="IntFlag.GetName">func (IntFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=6830:6863#L303">GetName</a></h3>
  1461. <pre>func (f <a href="index.html#IntFlag">IntFlag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  1462. <p>
  1463. GetName returns the name of the flag
  1464. </p>
  1465. <h3 id="IntFlag.String">func (IntFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=6728:6760#L298">String</a></h3>
  1466. <pre>func (f <a href="index.html#IntFlag">IntFlag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1467. <p>
  1468. String returns a readable representation of this value
  1469. (for usage defaults)
  1470. </p>
  1471. <h2 id="IntSlice">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=3220:3239#L127">IntSlice</a></h2>
  1472. <pre>type IntSlice []<a href="../../../builtin/index.html#int">int</a></pre>
  1473. <p>
  1474. IntSlice is an opaque type for []int to satisfy flag.Value
  1475. </p>
  1476. <h3 id="IntSlice.Set">func (*IntSlice) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=3318:3360#L130">Set</a></h3>
  1477. <pre>func (f *<a href="index.html#IntSlice">IntSlice</a>) Set(value <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  1478. <p>
  1479. Set parses the value into an integer and appends it to the list of values
  1480. </p>
  1481. <h3 id="IntSlice.String">func (*IntSlice) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=3545:3579#L140">String</a></h3>
  1482. <pre>func (f *<a href="index.html#IntSlice">IntSlice</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1483. <p>
  1484. String returns a readable representation of this value (for usage defaults)
  1485. </p>
  1486. <h3 id="IntSlice.Value">func (*IntSlice) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=3668:3700#L145">Value</a></h3>
  1487. <pre>func (f *<a href="index.html#IntSlice">IntSlice</a>) Value() []<a href="../../../builtin/index.html#int">int</a></pre>
  1488. <p>
  1489. Value returns the slice of ints set by this flag
  1490. </p>
  1491. <h2 id="IntSliceFlag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=7525:7629#L335">IntSliceFlag</a></h2>
  1492. <pre>type IntSliceFlag struct {
  1493. Name <a href="../../../builtin/index.html#string">string</a>
  1494. Usage <a href="../../../builtin/index.html#string">string</a>
  1495. EnvVar <a href="../../../builtin/index.html#string">string</a>
  1496. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  1497. Value *<a href="index.html#IntSlice">IntSlice</a>
  1498. }</pre>
  1499. <p>
  1500. IntSliceFlag is a flag with type *IntSlice
  1501. </p>
  1502. <h3 id="IntSliceFlag.Apply">func (IntSliceFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=3780:3826#L150">Apply</a></h3>
  1503. <pre>func (f <a href="index.html#IntSliceFlag">IntSliceFlag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  1504. <p>
  1505. Apply populates the flag given the flag set and environment
  1506. </p>
  1507. <h3 id="IntSliceFlag.GetName">func (IntSliceFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=7820:7858#L350">GetName</a></h3>
  1508. <pre>func (f <a href="index.html#IntSliceFlag">IntSliceFlag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  1509. <p>
  1510. GetName returns the name of the flag
  1511. </p>
  1512. <h3 id="IntSliceFlag.String">func (IntSliceFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=7713:7750#L345">String</a></h3>
  1513. <pre>func (f <a href="index.html#IntSliceFlag">IntSliceFlag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1514. <p>
  1515. String returns a readable representation of this value
  1516. (for usage defaults)
  1517. </p>
  1518. <h2 id="MultiError">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/errors.go?s=393:435#L8">MultiError</a></h2>
  1519. <pre>type MultiError struct {
  1520. Errors []<a href="../../../builtin/index.html#error">error</a>
  1521. }</pre>
  1522. <p>
  1523. MultiError is an error that wraps multiple errors.
  1524. </p>
  1525. <h3 id="NewMultiError">func <a href="http://localhost:6060/src/github.com/codegangsta/cli/errors.go?s=508:551#L13">NewMultiError</a></h3>
  1526. <pre>func NewMultiError(err ...<a href="../../../builtin/index.html#error">error</a>) <a href="index.html#MultiError">MultiError</a></pre>
  1527. <p>
  1528. NewMultiError creates a new MultiError. Pass in one or more errors.
  1529. </p>
  1530. <h3 id="MultiError.Error">func (MultiError) <a href="http://localhost:6060/src/github.com/codegangsta/cli/errors.go?s=628:662#L18">Error</a></h3>
  1531. <pre>func (m <a href="index.html#MultiError">MultiError</a>) Error() <a href="../../../builtin/index.html#string">string</a></pre>
  1532. <p>
  1533. Error implents the error interface.
  1534. </p>
  1535. <h2 id="OnUsageErrorFunc">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/funcs.go?s=1034:1114#L14">OnUsageErrorFunc</a></h2>
  1536. <pre>type OnUsageErrorFunc func(context *<a href="index.html#Context">Context</a>, err <a href="../../../builtin/index.html#error">error</a>, isSubcommand <a href="../../../builtin/index.html#bool">bool</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  1537. <p>
  1538. OnUsageErrorFunc is executed if an usage error occurs. This is useful for displaying
  1539. customized usage error messages. This function is able to replace the
  1540. original error messages. If this function is not set, the &#34;Incorrect usage&#34;
  1541. is displayed and the execution is interrupted.
  1542. </p>
  1543. <h2 id="StringFlag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=9660:9805#L429">StringFlag</a></h2>
  1544. <pre>type StringFlag struct {
  1545. Name <a href="../../../builtin/index.html#string">string</a>
  1546. Usage <a href="../../../builtin/index.html#string">string</a>
  1547. EnvVar <a href="../../../builtin/index.html#string">string</a>
  1548. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  1549. Value <a href="../../../builtin/index.html#string">string</a>
  1550. Destination *<a href="../../../builtin/index.html#string">string</a>
  1551. }</pre>
  1552. <p>
  1553. StringFlag is a flag with type string
  1554. </p>
  1555. <h3 id="StringFlag.Apply">func (StringFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=6842:6886#L279">Apply</a></h3>
  1556. <pre>func (f <a href="index.html#StringFlag">StringFlag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  1557. <p>
  1558. Apply populates the flag given the flag set and environment
  1559. </p>
  1560. <h3 id="StringFlag.GetName">func (StringFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=9994:10030#L445">GetName</a></h3>
  1561. <pre>func (f <a href="index.html#StringFlag">StringFlag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  1562. <p>
  1563. GetName returns the name of the flag
  1564. </p>
  1565. <h3 id="StringFlag.String">func (StringFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=9889:9924#L440">String</a></h3>
  1566. <pre>func (f <a href="index.html#StringFlag">StringFlag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1567. <p>
  1568. String returns a readable representation of this value
  1569. (for usage defaults)
  1570. </p>
  1571. <h2 id="StringSlice">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=2136:2161#L83">StringSlice</a></h2>
  1572. <pre>type StringSlice []<a href="../../../builtin/index.html#string">string</a></pre>
  1573. <p>
  1574. StringSlice is an opaque type for []string to satisfy flag.Value
  1575. </p>
  1576. <h3 id="StringSlice.Set">func (*StringSlice) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=2217:2262#L86">Set</a></h3>
  1577. <pre>func (f *<a href="index.html#StringSlice">StringSlice</a>) Set(value <a href="../../../builtin/index.html#string">string</a>) <a href="../../../builtin/index.html#error">error</a></pre>
  1578. <p>
  1579. Set appends the string value to the list of values
  1580. </p>
  1581. <h3 id="StringSlice.String">func (*StringSlice) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=2383:2420#L92">String</a></h3>
  1582. <pre>func (f *<a href="index.html#StringSlice">StringSlice</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1583. <p>
  1584. String returns a readable representation of this value (for usage defaults)
  1585. </p>
  1586. <h3 id="StringSlice.Value">func (*StringSlice) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=2511:2549#L97">Value</a></h3>
  1587. <pre>func (f *<a href="index.html#StringSlice">StringSlice</a>) Value() []<a href="../../../builtin/index.html#string">string</a></pre>
  1588. <p>
  1589. Value returns the slice of strings set by this flag
  1590. </p>
  1591. <h2 id="StringSliceFlag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=10721:10831#L477">StringSliceFlag</a></h2>
  1592. <pre>type StringSliceFlag struct {
  1593. Name <a href="../../../builtin/index.html#string">string</a>
  1594. Usage <a href="../../../builtin/index.html#string">string</a>
  1595. EnvVar <a href="../../../builtin/index.html#string">string</a>
  1596. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  1597. Value *<a href="index.html#StringSlice">StringSlice</a>
  1598. }</pre>
  1599. <p>
  1600. StringSliceFlag is a flag with type *StringSlice
  1601. </p>
  1602. <h3 id="StringSliceFlag.Apply">func (StringSliceFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=2629:2678#L102">Apply</a></h3>
  1603. <pre>func (f <a href="index.html#StringSliceFlag">StringSliceFlag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  1604. <p>
  1605. Apply populates the flag given the flag set and environment
  1606. </p>
  1607. <h3 id="StringSliceFlag.GetName">func (StringSliceFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=11025:11066#L492">GetName</a></h3>
  1608. <pre>func (f <a href="index.html#StringSliceFlag">StringSliceFlag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  1609. <p>
  1610. GetName returns the name of the flag
  1611. </p>
  1612. <h3 id="StringSliceFlag.String">func (StringSliceFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=10915:10955#L487">String</a></h3>
  1613. <pre>func (f <a href="index.html#StringSliceFlag">StringSliceFlag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1614. <p>
  1615. String returns a readable representation of this value
  1616. (for usage defaults)
  1617. </p>
  1618. <h2 id="Uint64Flag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=11818:11963#L524">Uint64Flag</a></h2>
  1619. <pre>type Uint64Flag struct {
  1620. Name <a href="../../../builtin/index.html#string">string</a>
  1621. Usage <a href="../../../builtin/index.html#string">string</a>
  1622. EnvVar <a href="../../../builtin/index.html#string">string</a>
  1623. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  1624. Value <a href="../../../builtin/index.html#uint64">uint64</a>
  1625. Destination *<a href="../../../builtin/index.html#uint64">uint64</a>
  1626. }</pre>
  1627. <p>
  1628. Uint64Flag is a flag with type uint64
  1629. </p>
  1630. <h3 id="Uint64Flag.Apply">func (Uint64Flag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=9087:9131#L372">Apply</a></h3>
  1631. <pre>func (f <a href="index.html#Uint64Flag">Uint64Flag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  1632. <p>
  1633. Apply populates the flag given the flag set and environment
  1634. </p>
  1635. <h3 id="Uint64Flag.GetName">func (Uint64Flag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=12152:12188#L540">GetName</a></h3>
  1636. <pre>func (f <a href="index.html#Uint64Flag">Uint64Flag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  1637. <p>
  1638. GetName returns the name of the flag
  1639. </p>
  1640. <h3 id="Uint64Flag.String">func (Uint64Flag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=12047:12082#L535">String</a></h3>
  1641. <pre>func (f <a href="index.html#Uint64Flag">Uint64Flag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1642. <p>
  1643. String returns a readable representation of this value
  1644. (for usage defaults)
  1645. </p>
  1646. <h2 id="UintFlag">type <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=12873:13012#L572">UintFlag</a></h2>
  1647. <pre>type UintFlag struct {
  1648. Name <a href="../../../builtin/index.html#string">string</a>
  1649. Usage <a href="../../../builtin/index.html#string">string</a>
  1650. EnvVar <a href="../../../builtin/index.html#string">string</a>
  1651. Hidden <a href="../../../builtin/index.html#bool">bool</a>
  1652. Value <a href="../../../builtin/index.html#uint">uint</a>
  1653. Destination *<a href="../../../builtin/index.html#uint">uint</a>
  1654. }</pre>
  1655. <p>
  1656. UintFlag is a flag with type uint
  1657. </p>
  1658. <h3 id="UintFlag.Apply">func (UintFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag.go?s=8502:8544#L348">Apply</a></h3>
  1659. <pre>func (f <a href="index.html#UintFlag">UintFlag</a>) Apply(set *<a href="../../../flag/index.html">flag</a>.<a href="../../../flag/index.html#FlagSet">FlagSet</a>)</pre>
  1660. <p>
  1661. Apply populates the flag given the flag set and environment
  1662. </p>
  1663. <h3 id="UintFlag.GetName">func (UintFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=13199:13233#L588">GetName</a></h3>
  1664. <pre>func (f <a href="index.html#UintFlag">UintFlag</a>) GetName() <a href="../../../builtin/index.html#string">string</a></pre>
  1665. <p>
  1666. GetName returns the name of the flag
  1667. </p>
  1668. <h3 id="UintFlag.String">func (UintFlag) <a href="http://localhost:6060/src/github.com/codegangsta/cli/flag_generated.go?s=13096:13129#L583">String</a></h3>
  1669. <pre>func (f <a href="index.html#UintFlag">UintFlag</a>) String() <a href="../../../builtin/index.html#string">string</a></pre>
  1670. <p>
  1671. String returns a readable representation of this value
  1672. (for usage defaults)
  1673. </p>
  1674. <h2 id="pkg-subdirectories">Subdirectories</h2>
  1675. <div class="pkg-dir">
  1676. <table>
  1677. <tr>
  1678. <th class="pkg-name">Name</th>
  1679. <th class="pkg-synopsis">Synopsis</th>
  1680. </tr>
  1681. <tr>
  1682. <td colspan="2"><a href="../index.html">..</a></td>
  1683. </tr>
  1684. <tr>
  1685. <td class="pkg-name" style="padding-left: 0px;">
  1686. <a href="altsrc/index.html">altsrc</a>
  1687. </td>
  1688. <td class="pkg-synopsis">
  1689. </td>
  1690. </tr>
  1691. </table>
  1692. </div>
  1693. <div id="footer">
  1694. Build version go1.6.<br>
  1695. Except as <a href="https://developers.google.com/site-policies#restrictions">noted</a>,
  1696. the content of this page is licensed under the
  1697. Creative Commons Attribution 3.0 License,
  1698. and code is licensed under a <a href="http://localhost:6060/LICENSE">BSD license</a>.<br>
  1699. <a href="http://localhost:6060/doc/tos.html">Terms of Service</a> |
  1700. <a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
  1701. </div>
  1702. </div><!-- .container -->
  1703. </div><!-- #page -->
  1704. <!-- TODO(adonovan): load these from <head> using "defer" attribute? -->
  1705. <script type="text/javascript" src="../../../../lib/godoc/jquery.js"></script>
  1706. <script type="text/javascript" src="../../../../lib/godoc/jquery.treeview.js"></script>
  1707. <script type="text/javascript" src="../../../../lib/godoc/jquery.treeview.edit.js"></script>
  1708. <script type="text/javascript" src="../../../../lib/godoc/godocs.js"></script>
  1709. </body>
  1710. </html>