docs: def main(args=None):
      """Build and run parser
  
      :param args: cli args from tests
      """
      parser = argument_parser()
      args = parser.parse_args(args)
  
      # If 'func' isn't present, something is misconfigured above or no (positional) arg was given.
      if not hasattr(args, 'func'):
          args = parser.parse_args(['help'])  # show help
  
      # Convert argparse.Namespace into dict and clean it up.
      # We can then pass it directly to the helper function.
      kwargs = vars(args)
  
      # handle the '--dev' option
      if kwargs.pop('dev') or os.environ.get('QUILT_DEV_MODE', '').strip().lower() == 'true':
          # Enables CLI ctrl-c tracebacks, and whatever anyone else uses it for
          quilt._DEV_MODE = True
      else:
          # Disables CLI ctrl-c tracebacks, etc.
          quilt._DEV_MODE = False
  
      func = kwargs.pop('func')
  
      try:
          func(**kwargs)
          return 0
      except QuiltException as ex:
          print(ex.message, file=sys.stderr)
          return 1
      except requests.exceptions.ConnectionError as ex:
          print("Failed to connect: %s" % ex, file=sys.stderr)
          return 1