@deprecated('use args.pop(0)')
def pop_arg(args_list, expected_size_after=None, msg='Missing argument'):
 try:
  value = args_list.pop(0)
 except IndexError:
  raise BadCommandUsage(msg)
 if ((expected_size_after is not None) and (len(args_list) > expected_size_after)):
  raise BadCommandUsage('too many arguments')
 return value

@ deprecated ( 'use args.pop(0)' ) def pop_arg ( args_list , expected_size_after = None , msg = 'Missing argument' ) : try : value = args_list . pop ( 0 ) except IndexError : raise BadCommandUsage ( msg ) if ( ( expected_size_after is not None ) and ( len ( args_list ) > expected_size_after ) ) : raise BadCommandUsage ( 'too many arguments' ) return value
helper function to get and check command line arguments .