def add_arg(argument_table, **kwargs): """ This is our event handler. It will get called as the top-level parameters are getting built. We can add our custom options to the ``argument_table``. The easiest way to do this is to just create an instance of the ``BuiltInArgument`` class defined in ``clidriver.py``. """ # When we create the new BuiltInArgument, we pass in it's name # and, optionally, any additional parameters we want to pass to # argparse when this argument is added to the parser. Since we # want this to be a boolean option, we do need to do some extra # configuration. # Also, if you want to add a help string that gets printed # when the user does ``aws help`` you should add that to the # dictionary, too. argument = BuiltInArgument('foobar', {'action': 'store_true', 'help': HELP}) argument.add_to_arg_table(argument_table)
def inject_new_param(self, argument_table, **kwargs): argument = BuiltInArgument('unknown-arg', {}) argument.add_to_arg_table(argument_table)