Skip to content

Commit

Permalink
Update CLI command messages for weasel usage (#71)
Browse files Browse the repository at this point in the history
* Update CLI command messages for weasel usage

* Remove import
  • Loading branch information
adrianeboyd authored Oct 26, 2023
1 parent 1b7f340 commit 64a4613
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion weasel/cli/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def project_clone(
msg.warn(f"No {PROJECT_FILE} found in directory")
else:
msg.good("Your project is now ready!")
print(f"To fetch the assets, run:\n{COMMAND} project assets {dest}")
print(f"To fetch the assets, run:\n{COMMAND} assets {dest}")


def check_clone(name: str, dest: Path, repo: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion weasel/cli/dvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
UPDATE_COMMAND = "dvc"
DVC_CONFIG_COMMENT = f"""# This file is auto-generated by Weasel based on your {PROJECT_FILE}. If you've
# edited your {PROJECT_FILE}, you can regenerate this file by running:
# {COMMAND} project {UPDATE_COMMAND}"""
# {COMMAND} {UPDATE_COMMAND}"""


@app.command(UPDATE_COMMAND)
Expand Down
8 changes: 4 additions & 4 deletions weasel/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def print_run_help(project_dir: Path, subcommand: Optional[str] = None) -> None:
project_loc = "" if is_cwd(project_dir) else project_dir
if subcommand:
validate_subcommand(list(commands.keys()), list(workflows.keys()), subcommand)
print(f"Usage: {COMMAND} project run {subcommand} {project_loc}")
print(f"Usage: {COMMAND} run {subcommand} {project_loc}")
if subcommand in commands:
help_text = commands[subcommand].get("help")
if help_text:
Expand All @@ -131,7 +131,7 @@ def print_run_help(project_dir: Path, subcommand: Optional[str] = None) -> None:
for i, step in enumerate(steps)
]
msg.table(steps_data)
help_cmd = f"{COMMAND} project run [COMMAND] {project_loc} --help"
help_cmd = f"{COMMAND} run [COMMAND] {project_loc} --help"
print(f"For command details, run: {help_cmd}")
else:
print("")
Expand All @@ -140,11 +140,11 @@ def print_run_help(project_dir: Path, subcommand: Optional[str] = None) -> None:
print(f"{locale_escape(title)}\n")
if config_commands:
print(f"Available commands in {PROJECT_FILE}")
print(f"Usage: {COMMAND} project run [COMMAND] {project_loc}")
print(f"Usage: {COMMAND} run [COMMAND] {project_loc}")
msg.table([(cmd["name"], cmd.get("help", "")) for cmd in config_commands])
if workflows:
print(f"Available workflows in {PROJECT_FILE}")
print(f"Usage: {COMMAND} project run [WORKFLOW] {project_loc}")
print(f"Usage: {COMMAND} run [WORKFLOW] {project_loc}")
msg.table([(name, " -> ".join(steps)) for name, steps in workflows.items()])


Expand Down
4 changes: 2 additions & 2 deletions weasel/util/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from confection import ConfigValidationError
from wasabi import msg

from ..cli.main import COMMAND, PROJECT_FILE
from ..cli.main import PROJECT_FILE

if TYPE_CHECKING:
pass
Expand Down Expand Up @@ -51,7 +51,7 @@ def show_validation_error(
"fill-config' command to fill in all the defaults, if possible:",
spaced=True,
)
print(f"{COMMAND} init fill-config {config_path} {config_path} \n")
print(f"python -m spacy init fill-config {config_path} {config_path} \n")
sys.exit(1)
except InterpolationError as e:
msg.fail("Config validation error", e, exits=1)
Expand Down

0 comments on commit 64a4613

Please sign in to comment.