I was writing down a code in python which makes use of argparse module to make it easier to use it.
I can add arguments in the form of flags like:
parser.add_argument('-u', '--url', dest='url', help='type in url')
But like in gobuster, when you use help flag (-h) you can see you can also pass commands like dir,fuzz,etc. They also have separate help flags for each of them like
gobuster dir --help
how to achieve this? I can make flags without arguments by:
parser.add_argument('R', action='store_true', help='allow recursion')
In short, I'm trying to find out how to define commands separately so that they also show up under commands in help section and not under optional arguments. I'm also trying to find out how to create a separate help section for each command.