Skip to content

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Dec 3, 2025

Summary

  • Update Cargo.lock to usage-lib 2.9.0
  • Fix breaking API change: default field changed from Option<String> to Vec<String> in SpecArg and SpecFlag structs

Test plan

  • cargo check --all-features passes
  • Pre-commit lint passes

🤖 Generated with Claude Code


Note

Bumps usage-lib and updates parser, usage spec, and generated docs/man to use Vec defaults, with new e2e tests validating variadic args/flags and defaults behavior.

  • Core (task script parsing):
    • Switch default handling to arrays (Vec<String>) for args/flags in src/task/task_script_parser.rs.
    • Build usage context with arrays for variadic args/flags (including defaults) and correct boolean/string defaults.
  • CLI Spec & Docs:
    • Add explicit defaults across mise.usage.kdl (e.g., --type=infer, --localized-dir=.mise, --task=pre-commit|ci, --style=simple, --dir=bin, --mise-bin=mise, --http=http, --version=latest, --match-type=fuzzy, --on-busy-update=do-nothing, --stop-timeout=10s, --debounce=50ms, --emit-events-to=none, --wrap-process=group, --color=auto, --fs-events=create,remove,rename,modify,metadata).
    • Regenerate docs/cli/* and man/man1/mise.1 to display these defaults.
  • Tests:
    • Expand e2e coverage for Tera usage map: variadic flag join, multi-default arrays, string default non-splitting, arg defaults, variadic arg defaults.
  • Deps:
    • Update Cargo.lock: usage-lib 2.8.0 → 2.9.0.

Written by Cursor Bugbot for commit 2f5f4c2. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings December 3, 2025 23:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the usage-lib dependency to version 2.9.0 and adapts the codebase to handle a breaking API change where the default field in SpecArg and SpecFlag structs changed from Option<String> to Vec<String>.

  • Wraps single default values in vectors using .map(|s| vec![s]) to match the new API
  • Updates flag default value access to use .first() to extract the first element from the vector
  • Maintains backward compatibility by providing empty vectors as fallback

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jdx jdx enabled auto-merge (squash) December 3, 2025 23:57
jdx and others added 4 commits December 3, 2025 17:58
- Update Cargo.lock to usage-lib 2.9.0
- Fix breaking API change: default field changed from Option<String> to Vec<String>
  in SpecArg and SpecFlag structs
- Variadic flags (var=#true) now return empty arrays instead of empty strings
  for their default values in the Tera usage context
- Flag defaults are now properly used (instead of always returning empty values)
- Enable previously disabled e2e tests for variadic flag join and defaults
- Update test to use proper KDL syntax for multiple defaults
@iamkroot
Copy link
Contributor

iamkroot commented Dec 3, 2025

Ah, I have a different implementation at #7179

@jdx jdx force-pushed the chore/bump-usage branch from 81e7df2 to 132568d Compare December 3, 2025 23:59
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.11 x -- echo 19.0 ± 0.5 18.2 23.3 1.00
mise x -- echo 19.1 ± 0.4 18.4 20.8 1.01 ± 0.03

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.11 env 18.5 ± 0.4 17.8 19.8 1.00
mise env 18.8 ± 0.5 17.8 22.5 1.02 ± 0.03

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.11 hook-env 18.4 ± 0.6 17.8 25.9 1.00
mise hook-env 18.6 ± 0.4 17.9 20.3 1.01 ± 0.04

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.11 ls 15.9 ± 0.4 15.1 17.6 1.02 ± 0.03
mise ls 15.5 ± 0.2 15.1 17.2 1.00

xtasks/test/perf

Command mise-2025.11.11 mise Variance
install (cached) 106ms 105ms +0%
ls (cached) 64ms 64ms +0%
bin-paths (cached) 70ms 71ms -1%
task-ls (cached) 430ms 427ms +0%

@jdx jdx disabled auto-merge December 4, 2025 00:18
- Variadic args with defaults now return arrays with default values
- Non-variadic args with defaults now use the default value
- Add e2e tests for args with defaults (single and variadic)
- Add test for variadic flag with string default (single element)

Co-Authored-By: Krut Patel <[email protected]>
@jdx jdx force-pushed the chore/bump-usage branch from 132568d to 2f5f4c2 Compare December 4, 2025 00:20
@jdx jdx enabled auto-merge (squash) December 4, 2025 00:20
@jdx jdx merged commit d795907 into main Dec 4, 2025
29 checks passed
@jdx jdx deleted the chore/bump-usage branch December 4, 2025 00:38
jdx pushed a commit that referenced this pull request Dec 4, 2025
### 🚀 Features

- **(config)** add support for netrc by @RobotSupervisor in
[#7164](#7164)
- **(lock)** add resolve_lock_info to core backends for checksum
fetching by @jdx in [#7180](#7180)
- **(ruby)** Install ruby from a zip file over HTTPS by @KaanYT in
[#7167](#7167)
- **(tasks)** add `usage` args to Tera context in run scripts by
@iamkroot in [#7041](#7041)

### 🐛 Bug Fixes

- **(lock)** validate platform qualifiers when reading from lockfile by
@jdx in [#7181](#7181)
- **(task)** retry shebang scripts on ETXTBUSY by @iamkroot in
[#7162](#7162)
- **(ui)** remove duplicate 'mise' prefix in verbose footer output by
@jdx in [#7174](#7174)

### 📦️ Dependency Updates

- bump usage-lib to 2.9.0 by @jdx in
[#7177](#7177)

### 📦 Registry

- remove duplicated ubi and github backends from gping by @risu729 in
[#7144](#7144)
- disable bashly test (not working in CI) by @jdx in
[#7173](#7173)
- disable cfn-lint test (failing in CI) by @jdx in
[#7176](#7176)

### Chore

- add fd to mise.toml by @blampe in
[#7178](#7178)

### New Contributors

- @RobotSupervisor made their first contribution in
[#7164](#7164)

## 📦 Aqua Registry Updates

#### New Packages (2)

- [`Kitware/CMake`](https://github.com/Kitware/CMake)
- [`quarto-dev/quarto-cli`](https://github.com/quarto-dev/quarto-cli)

#### Updated Packages (6)

- [`apache/jena`](https://github.com/apache/jena)
- [`apache/spark`](https://github.com/apache/spark)
-
[`danielfoehrKn/kubeswitch`](https://github.com/danielfoehrKn/kubeswitch)
-
[`danielfoehrKn/kubeswitch/switch-sh`](https://github.com/danielfoehrKn/kubeswitch/switch-sh)
- [`evilmartians/lefthook`](https://github.com/evilmartians/lefthook)
- [`updatecli/updatecli`](https://github.com/updatecli/updatecli)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants