code: def main(argv=None):
      
  
      parser = argparse.ArgumentParser(
          description='Commands as arguments'
      )
      command_help = 'optional command to run, if no command given, enter an interactive shell'
      parser.add_argument('command', nargs='?',
                          help=command_help)
      arg_help = 'optional arguments for command'
      parser.add_argument('command_args', nargs=argparse.REMAINDER,
                          help=arg_help)
  
      args = parser.parse_args(argv)
  
      c = CmdLineApp()
  
      if args.command:
          # we have a command, run it and then exit
          c.onecmd_plus_hooks('{} {}'.format(args.command, ' '.join(args.command_args)))
      else:
          # we have no command, drop into interactive mode
          c.cmdloop()
docs: Run when invoked from the operating system shell