def add_args_options(arg_parser, interface):
 inputs = interface.input_spec()
 for (name, spec) in sorted(interface.inputs.traits(transient=None).items()):
  desc = u'\n'.join(interface._get_trait_desc(inputs, name, spec))[(len(name) + 2):]
  args = {}
  if spec.is_trait_type(traits.Bool):
   args[u'action'] = u'store_true'
  if (hasattr(spec, u'mandatory') and spec.mandatory):
   if spec.is_trait_type(InputMultiPath):
    args[u'nargs'] = u'+'
   arg_parser.add_argument(name, help=desc, **args)
  else:
   if spec.is_trait_type(InputMultiPath):
    args[u'nargs'] = u'*'
   arg_parser.add_argument((u'--%s' % name), dest=name, help=desc, **args)
 return arg_parser

def add_args_options ( arg_parser , interface ) : inputs = interface . input_spec ( ) for ( name , spec ) in sorted ( interface . inputs . traits ( transient = None ) . items ( ) ) : desc = u'\n' . join ( interface . _get_trait_desc ( inputs , name , spec ) ) [ ( len ( name ) + 2 ) : ] args = { } if spec . is_trait_type ( traits . Bool ) : args [ u'action' ] = u'store_true' if ( hasattr ( spec , u'mandatory' ) and spec . mandatory ) : if spec . is_trait_type ( InputMultiPath ) : args [ u'nargs' ] = u'+' arg_parser . add_argument ( name , help = desc , ** args ) else : if spec . is_trait_type ( InputMultiPath ) : args [ u'nargs' ] = u'*' arg_parser . add_argument ( ( u'--%s' % name ) , dest = name , help = desc , ** args ) return arg_parser
add arguments to arg_parser to create a cli for interface .