From 640972539f7a3f445e16db7b35948adaf1fa41aa Mon Sep 17 00:00:00 2001 From: monkeyman192 Date: Thu, 26 Dec 2024 00:01:04 +1100 Subject: [PATCH] gh-27: Add extra help info to argparser and reserve the init arg --- pymhf/__init__.py | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/pymhf/__init__.py b/pymhf/__init__.py index 233dcdb..22479d5 100644 --- a/pymhf/__init__.py +++ b/pymhf/__init__.py @@ -89,7 +89,13 @@ def run(): command_parser = parser.add_subparsers(dest="_command") # `run` command parser - run_parser = command_parser.add_parser("run") + run_parser = command_parser.add_parser( + "run", + help=( + "Run the provided plugin name (if registered), or the provided path to a module or single-file " + "mod." + ), + ) run_parser.add_argument( "plugin_name", help=( @@ -98,7 +104,13 @@ def run(): ), ) - config_parser = command_parser.add_parser("config") + config_parser = command_parser.add_parser( + "config", + help=( + "Configure the provided plugin name (if registered), or the provided path to a module or " + "single-file mod." + ), + ) config_parser.add_argument( "-o", "--open", @@ -114,6 +126,17 @@ def run(): ), ) + init_parser = command_parser.add_parser( + "init", help="[NOT YET IMPLEMENTED] Initialise a new empty project under the given name." + ) + init_parser.add_argument( + "plugin_name", + help=( + "The name of the installed library to run, or the single-file script to run, or the path to a " + "folder which contains a library to run locally." + ), + ) + args, extras = parser.parse_known_args() # noqa # TODO: The extras can be passed to the registered library in the future.