from flicktor import subcommands


def main():
    parser = subcommands._argpaser()
    args = parser.parse_args()
    try: 
        args.func(args)
    #  except AttributeError:
        #  parser.print_help()
    except KeyboardInterrupt:
        print("bye.")


if __name__ == '__main__':
    main()

from flicktor import subcommands


def main():
    parser = subcommands._argpaser()
    args = parser.parse_args()
    try: 
        if hasattr(args, "func"):
            args.func(args)
        else:
            parser.print_help()


    except KeyboardInterrupt:
        print("bye.")


if __name__ == '__main__':
    main()

Print help when subcommand is not supecified
Print help when subcommand is not supecified

  from flicktor import subcommands
  
  
  def main():
      parser = subcommands._argpaser()
      args = parser.parse_args()
      try: 
+         if hasattr(args, "func"):
-         args.func(args)
+             args.func(args)
-     #  except AttributeError:
+         else:
-         #  parser.print_help()
+             parser.print_help()
+ 
+ 
      except KeyboardInterrupt:
          print("bye.")
  
  
  if __name__ == '__main__':
      main()
  
Print help when subcommand is not supecified
## Code Before:
from flicktor import subcommands


def main():
    parser = subcommands._argpaser()
    args = parser.parse_args()
    try: 
        args.func(args)
    #  except AttributeError:
        #  parser.print_help()
    except KeyboardInterrupt:
        print("bye.")


if __name__ == '__main__':
    main()

## Instruction:
Print help when subcommand is not supecified
## Code After:
from flicktor import subcommands


def main():
    parser = subcommands._argpaser()
    args = parser.parse_args()
    try: 
        if hasattr(args, "func"):
            args.func(args)
        else:
            parser.print_help()


    except KeyboardInterrupt:
        print("bye.")


if __name__ == '__main__':
    main()
