title: Argparse nested subparsers
body: <p>I would like to created nested <code>subparsers</code> using the python 3 library <code>argparse</code>. At the moment I am getting this error message when trying to implement a solution:</p>
  
  <pre><code>AttributeError: 'ArgumentParser' object has no attribute 'add_parser'
  </code></pre>
  
  <p>Here is the code that I am using:</p>
  
  <pre><code>def parse_args():
      """
      Parse and validate user command line.
      """
      # Top-level parser
      parser = argparse.ArgumentParser(
          description="foo"
      )
  
      parser.add_argument(
          "-foo",
          dest="foo",
          help="foo",
          required=True,
          type=str
      )
  
      subparsers = parser.add_subparsers(help='sub-command help')
  
      # Parser for the "payload" command
      parser_payload = subparsers.add_parser(
          "payload", 
          help="payload help"
      )
  
      parser_payload.add_argument(
          "-b",
          "--bar",
          dest="bar",
          help="bar",
          type=str
      )
  
      # Parser for the "payload-&gt;foobar" command
      parser_payload_foobar = parser_payload.add_parser(
          "foobar"
          help="foobar help"
      )
  
      parser_payload_foobar.add_argument(
          "-bf",
          "--barfoo",
          dest="barfoo",
          help="barfoo",
          type=str
      )
  
      return parser.parse_args()
  </code></pre>