Skip to content

Commit 8f89e01

Browse files
Kamiruscursoragent
andcommitted
chore(cli): list managed tools in mops toolchain --help and on missing/invalid <tool>
Move the tool list from `bin`'s description into the parent `toolchain` description, add argument descriptions on `use`/`update`/`bin` so the choices show under `Arguments:`, and enable `showHelpAfterError()` so a bare `mops toolchain use` prints the help (with choices) instead of just `error: missing required argument 'tool'`. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c64a48a commit 8f89e01

2 files changed

Lines changed: 22 additions & 10 deletions

File tree

cli/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Mops CLI Changelog
22

33
## Next
4+
- `mops toolchain --help` now lists the tools mops manages (`moc`, `wasmtime`, `pocket-ic`, `lintoko`) in the top-level description instead of only mentioning them under `bin`, and `mops toolchain use` / `update` / `bin` print the available tools (via the auto-generated help) when invoked with a missing or invalid `<tool>` argument.
5+
46
- Add `--patch` to `mops update` and `mops outdated` to restrict updates to patch versions only (e.g. `1.2.3 -> 1.2.4`, never `1.2.3 -> 1.3.0`). Mutually exclusive with `--major`. For pre-1.0 packages this matches the default — caret already restricts `0.x.y` to patch updates. Useful for risk-averse upgrades on packages that have hit 1.0+.
57

68
- Improve the per-file integrity-check error after `mops install --lock update`. Previously the message told users to run `mops install --lock update` — the exact command that just failed. After a regenerated lockfile, the only way a per-file hash can still mismatch is a local edit under `.mops/`, so the message now says that and suggests restoring from the global cache (delete the `.mops/<pkg>` directory and run `mops install`) or using a `repo`/`path` entry in `mops.toml` to keep custom changes.

cli/cli.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,11 @@ program
674674
});
675675

676676
// toolchain
677-
const toolchainCommand = new Command("toolchain").description(
678-
"Toolchain management",
679-
);
677+
const toolchainCommand = new Command("toolchain")
678+
.description(
679+
`Toolchain management for ${TOOLCHAINS.map((s) => `"${s}"`).join(", ")}`,
680+
)
681+
.showHelpAfterError();
680682

681683
toolchainCommand
682684
.command("init")
@@ -695,8 +697,13 @@ toolchainCommand
695697
toolchainCommand
696698
.command("use")
697699
.description("Install specified tool version and update mops.toml")
698-
.addArgument(new Argument("<tool>").choices(TOOLCHAINS))
699-
.addArgument(new Argument("[version]"))
700+
.addArgument(new Argument("<tool>", "tool to install").choices(TOOLCHAINS))
701+
.addArgument(
702+
new Argument(
703+
"[version]",
704+
"version to install (defaults to interactive picker)",
705+
),
706+
)
700707
.action(async (tool, version) => {
701708
if (!checkConfigFile()) {
702709
process.exit(1);
@@ -709,7 +716,12 @@ toolchainCommand
709716
.description(
710717
"Update specified tool or all tools to the latest version and update mops.toml",
711718
)
712-
.addArgument(new Argument("[tool]").choices(TOOLCHAINS))
719+
.addArgument(
720+
new Argument(
721+
"[tool]",
722+
"tool to update (defaults to all configured tools)",
723+
).choices(TOOLCHAINS),
724+
)
713725
.action(async (tool?: Tool) => {
714726
if (!checkConfigFile()) {
715727
process.exit(1);
@@ -719,10 +731,8 @@ toolchainCommand
719731

720732
toolchainCommand
721733
.command("bin")
722-
.description(
723-
`Get path to the tool binary\n<tool> can be one of ${TOOLCHAINS.map((s) => `"${s}"`).join(", ")}`,
724-
)
725-
.addArgument(new Argument("<tool>").choices(TOOLCHAINS))
734+
.description("Get path to the tool binary")
735+
.addArgument(new Argument("<tool>", "tool to look up").choices(TOOLCHAINS))
726736
.addOption(
727737
new Option(
728738
"--fallback",

0 commit comments

Comments
 (0)