Skip to content

Commit

Permalink
Bump Clap 3 -> 4 (#991)
Browse files Browse the repository at this point in the history
* fix(deps): update clap-rs to v4

* Define enums for multi-choice clap args

* fix test

* Update command docs

* Add `all` alias to log-level

* remove unused thing

* Add changeset

* Use `Shells` instead of `Box<dyn Shell>` everywhere

* Revert "Use `Shells` instead of `Box<dyn Shell>` everywhere"

This reverts commit 7781b5d.

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
amitdahan and renovate[bot] authored Jul 3, 2023
1 parent 8c76ca6 commit b19eb29
Show file tree
Hide file tree
Showing 13 changed files with 662 additions and 726 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-olives-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fnm": patch
---

Bump Clap 3 -> 4
7 changes: 5 additions & 2 deletions .ci/print-command-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@ async function getCommandHelp(fnmPath, command) {
const result = await run(fnmPath, [...cmdArg, "--help"])
const text = result.stdout
const rows = text.split("\n")
const headerIndex = rows.findIndex((x) => x.includes("SUBCOMMANDS"))
const headerIndex = rows.findIndex((x) => x.includes("Commands:"))
/** @type {string[]} */
const subcommands = []
if (!command) {
for (const row of rows.slice(headerIndex + 1)) {
for (const row of rows.slice(
headerIndex + 1,
rows.indexOf("", headerIndex + 1)
)) {
const [, word] = row.split(/\s+/)
if (word && word[0].toLowerCase() === word[0]) {
subcommands.push(word)
Expand Down
137 changes: 82 additions & 55 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = "Fast and simple Node.js version manager"

[dependencies]
serde = { version = "1.0.164", features = ["derive"] }
clap = { version = "3.2.25", features = ["derive", "env"] }
clap = { version = "4.3.10", features = ["derive", "env"] }
serde_json = "1.0.99"
chrono = { version = "0.4.26", features = ["serde"] }
tar = "0.4.38"
Expand All @@ -28,7 +28,7 @@ reqwest = { version = "0.11.18", features = ["blocking", "json", "rustls-tls", "
url = "2.4.0"
sysinfo = "0.29.3"
thiserror = "1.0.40"
clap_complete = "3.2.5"
clap_complete = "4.3.1"
anyhow = "1.0.71"

[dev-dependencies]
Expand Down
Loading

0 comments on commit b19eb29

Please sign in to comment.