title: Python: argument parser - multiple arguments without "--" allowed, not required
body: <p>I am struggling to write a simple python script (a pseudo-git), which will allow me to call it from commandline/shell using comand like this:</p>
  
  <pre><code>$ python script.py init
  </code></pre>
  
  <p>I found some solutions online, which enabled me to do so, but there is little issue though. I want "add" function to accept other arguments as well (strings in general, which will represent files' names). </p>
  
  <p>I have found a workaround, but it doesn't look nice. Is there a way to refactor the code, so that "add" will accept also other arguments and let me access them later on? Important thing: I don't want them to be added with "--", I'd rather separate them by simply adding space between two arguments.</p>
  
  <p>I found "nargs='+' option in add_argument, but I don't know how to redirect the argument to call a proper function.</p>
  
  <p>Here is my code I wrote so far:</p>
  
  <pre><code>import argparse
  import sys
  
  def init():
      print("init method call")
  
  def add():
      if(len(sys.argv)&gt;2):
          print("valid add method call")
      else:
          print("invalid call")
  
  def commit():
      print("commit method call") 
  
  def status():
      print("status method call") 
  
  def test():
      print("test method call")   
  
  FUNCTION_MAP = {'init' : init,
                  'status' : status,
                  'commit': commit}
  
  if __name__ == '__main__':
      if(len(sys.argv)&gt;1 and sys.argv[1] == "add"):
          add()
      else:           
          parser = argparse.ArgumentParser()
          parser.add_argument('command', choices=FUNCTION_MAP.keys())
          args = parser.parse_args()
          func = FUNCTION_MAP[args.command]
          func()
  </code></pre>