Simple command line parser with an advanced style, colors hints.
Python
ultron-shell
ultron-shell is a one of multiple powerful ultron packages.
ultron-shell is a feature-rich command line parser for Python.
ultron-shell supports positional arguments, flags, required arguments and more.
ultron-shell automatically generates usage by passing help argument, help and error messages.
usage
Simple example:
fromultron_shellimportUltronCommandLinefromtypingimportAny# Take an instance from UltronCommandLineultron: UltronCommandLine=UltronCommandLine()
# Call the add_command() method to add a new command to ultron name space.init: Any=ultron.add_command(command='init', help='initial command to test if it works.')
add: Any=ultron.add_command(command='add', help="add command.")
# Then you can call add_argument method to pass new argument to an exact command.# You can pass required = True in case if this argument is required to run the command.ultron.add_argument(init, "--config", "config file to configure", required=True)
ultron.add_argument(add, "--path", "path of directory")
# in case you wrote a lot of code and you forget what the command containes.ultron.get_command("add")
# in case you wrote a wrong command, you'll error hint into the terminal once you run.# Also you can get all argument attrs [help, required, value] by using.ultron.get_argument(add, "--path") # make sure that you passed the actual command varible.# in case you wrote a wrong command, you'll error hint into the terminal once you run.