File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 77
88The [ Basics] showed how to access arguments for a command. They are all retrieved as strings which is fine
99but it we need to say get integers or timestamps the user would have to convert from string to desired type.
10- To ease the burden on users the ` cli ` library offers predefined ` {Type}Arg ` and ` {Type}Args ` structure to faciliate this
10+ To ease the burden on users the ` cli ` library offers predefined ` {Type}Arg ` and ` {Type}Args ` structure to faciliate this.
1111The value of the argument can be retrieved using the ` command.{Type}Arg() ` function. For e.g
1212
1313<!-- {
@@ -152,9 +152,9 @@ func main() {
152152
153153Some things to note about multi value arguments
154154
155- 1 . They are of ` {Type}Args ` type rather than ` {Type}Arg ` to differentiate them from single value arguments
156- 2 . The ` Max ` field needs to be defined to a non zero value without which it cannot be parsed
157- 3 . ` Max ` field value needs to be greater than the ` Min ` field value
155+ 1 . They are of ` {Type}Args ` type rather than ` {Type}Arg ` to differentiate them from single value arguments.
156+ 2 . The ` Max ` field needs to be defined to a non zero value without which it cannot be parsed.
157+ 3 . ` Max ` field value needs to be greater than the ` Min ` field value.
158158
159159As with single value args the destination field can be set
160160
@@ -221,4 +221,4 @@ the following to the end of the Arguments slice and retrieve them as a slice
221221&StringArgs{
222222 Max: -1,
223223},
224- ```
224+ ```
Original file line number Diff line number Diff line change 55 boost : 2
66---
77
8- If default completion isnt sufficient additional customizations are available
8+ If default completion isn't sufficient additional customizations are available
99
1010- custom auto-completion
1111- customizing completion command
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ func main() {
144144 &cli.FloatFlag {Name: " howmuch" },
145145 &cli.IntFlag {Name: " longdistance" , Validator: func (t int ) error {
146146 if t < 10 {
147- return fmt.Errorf (" 10 miles isnt long distance!!!!" )
147+ return fmt.Errorf (" 10 miles isn't long distance!!!!" )
148148 }
149149 return nil
150150 }},
You can’t perform that action at this time.
0 commit comments