Skip to content

Commit

Permalink
cli message for global options
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetretto committed Jul 19, 2023
1 parent 92bffd8 commit 9917104
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/jobflow_remote/cli/jf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
add_completion=False,
no_args_is_help=True,
context_settings={"help_option_names": ["-h", "--help"]},
epilog=None, # to remove the default message in JFRTyper
)


Expand Down
11 changes: 11 additions & 0 deletions src/jobflow_remote/cli/jfr_typer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ class JFRTyper(typer.Typer):
Subclassing typer to intercept exceptions and print nicer error messages
"""

def __init__(self, *args, **kwargs):
if "epilog" not in kwargs:
kwargs[
"epilog"
] = "Run [bold]'jf -h'[/] to display the [bold]global options[/]"

if "rich_markup_mode" not in kwargs:
kwargs["rich_markup_mode"] = "rich"

super().__init__(*args, **kwargs)

def command(
self, *args, **kwargs
) -> Callable[[CommandFunctionType], CommandFunctionType]:
Expand Down
2 changes: 1 addition & 1 deletion src/jobflow_remote/cli/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def stop(
from jobflow_remote import SETTINGS

if SETTINGS.cli_suggestions:
out_console(
out_console.print(
"The stop signal has been sent to the Runner. Run 'jf runner status' to verify if it stopped",
style="yellow",
)
Expand Down

0 comments on commit 9917104

Please sign in to comment.