update README examples

This commit is contained in:
Emmanuel Garette 2019-01-28 11:44:50 +01:00
parent 727e8e86ca
commit 8e91667a66
1 changed files with 3 additions and 5 deletions

View File

@ -17,8 +17,8 @@ from tiramisu import IntOption, StrOption, BoolOption, ChoiceOption, \
choiceoption = ChoiceOption('cmd', choiceoption = ChoiceOption('cmd',
'choice the sub argument', 'choice the sub argument',
('str', 'list', 'int'), ('str', 'list', 'int'),
properties=('mandatory', properties=('mandatory',))
'positional')) # 'positional'))
# * a boolean to pass script in verbosity mode with argument -v --verbosity # * a boolean to pass script in verbosity mode with argument -v --verbosity
booloption = BoolOption('verbosity', booloption = BoolOption('verbosity',
'increase output verbosity', 'increase output verbosity',
@ -60,9 +60,7 @@ config = Config(OptionDescription('root',
int_ int_
])) ]))
# initialise the parser # initialise the parser
parser = TiramisuCmdlineParser() parser = TiramisuCmdlineParser(config)
# add the config to parser
parser.add_arguments(config)
# parse arguments of current script # parse arguments of current script
parser.parse_args() parser.parse_args()
# now, print the result # now, print the result