Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-27: Add extra help info to argparser and reserve the init arg #31

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions pymhf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=(
Expand All @@ -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",
Expand All @@ -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.
Expand Down
Loading