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

Improved CLI help messages #75

Merged
merged 1 commit into from
Oct 14, 2022
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
6 changes: 4 additions & 2 deletions src/arcaflow_plugin_sdk/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ def run(
if action is None:
raise _ExitException(
64,
"At least one of --file, --json-schema, or --http must be specified"
"At least one of --file, --json-schema, --schema, or --http must be specified"
)

if action == "file" or action == "json-schema":
if len(s.steps) > 1 and options.step is None:
raise _ExitException(64, "-s|--step is required\n" + parser.get_usage())
raise _ExitException(64, "-s|--step is required\n" + parser.get_usage() + "\nSteps: " + str(list(s.steps.keys())))
if options.step is not None:
step_id = options.step
else:
Expand Down Expand Up @@ -349,6 +349,8 @@ def _execute_file(


def _print_json_schema(step_id, s, options, stdout):
if step_id not in s.steps:
raise _ExitException(64, "Unknown step \"{}\". Steps: {}".format(step_id, str(list(s.steps.keys()))))
if options.json_schema == "input":
data = jsonschema.step_input(s.steps[step_id])
elif options.json_schema == "output":
Expand Down