flag: add fp.limit_free_args(0,0) to the readme example too

pull/7371/head
Delyan Angelov 2020-12-17 10:17:46 +02:00
parent 9bd14e8421
commit c4c0b5eb06
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 2 additions and 1 deletions

View File

@ -16,7 +16,8 @@ import flag
fn main() { fn main() {
mut fp := flag.new_flag_parser(os.args) mut fp := flag.new_flag_parser(os.args)
fp.application('flag_example_tool') fp.application('flag_example_tool')
fp.version('v0.0.0') fp.version('v0.0.1')
fp.limit_free_args(0, 0) // comment this, if you expect arbitrary texts after the options
fp.description('This tool is only designed to show how the flag lib is working') fp.description('This tool is only designed to show how the flag lib is working')
fp.skip_executable() fp.skip_executable()
an_int := fp.int('an_int', 0, 0o123, 'some int to define 0o123 is its default value') an_int := fp.int('an_int', 0, 0o123, 'some int to define 0o123 is its default value')