summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Knaack <davidkna@users.noreply.github.com>2022-09-29 23:51:56 +0200
committerGitHub <noreply@github.com>2022-09-29 16:51:56 -0500
commitc5bffb56201207b2c333226752a7580a199d2f2e (patch)
treeab1e89314577b653301fd801dc61c7a711543d4d
parent20b4bf156ba308bab561f47635e2d0789465ebea (diff)
build: bump clap from v3 to v4 (#4413)
* build: bump clap from v3 to v4 * bump
-rw-r--r--Cargo.lock28
-rw-r--r--Cargo.toml6
-rw-r--r--src/main.rs4
-rw-r--r--src/print.rs4
4 files changed, 16 insertions, 26 deletions
diff --git a/Cargo.lock b/Cargo.lock
index fd8f0122e..d35474b2a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -323,36 +323,35 @@ dependencies = [
[[package]]
name = "clap"
-version = "3.2.22"
+version = "4.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750"
+checksum = "31c9484ccdc4cb8e7b117cbd0eb150c7c0f04464854e4679aeb50ef03b32d003"
dependencies = [
"atty",
"bitflags",
"clap_derive",
"clap_lex",
- "indexmap",
"once_cell",
"strsim",
"termcolor",
- "textwrap",
"unicase",
+ "unicode-width",
]
[[package]]
name = "clap_complete"
-version = "3.2.5"
+version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f7a2e0a962c45ce25afce14220bc24f9dade0a1787f185cecf96bfba7847cd8"
+checksum = "f04c8f8007e8a1813ba933df2d8fb50cad04e0d9e89a22d64485f25a6a6c35d8"
dependencies = [
"clap",
]
[[package]]
name = "clap_derive"
-version = "3.2.18"
+version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65"
+checksum = "ca689d7434ce44517a12a89456b2be4d1ea1cafcd8f581978c03d45f5a5c12a7"
dependencies = [
"heck 0.4.0",
"proc-macro-error",
@@ -363,9 +362,9 @@ dependencies = [
[[package]]
name = "clap_lex"
-version = "0.2.4"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
+checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"
dependencies = [
"os_str_bytes",
]
@@ -2998,15 +2997,6 @@ dependencies = [
]
[[package]]
-name = "textwrap"
-version = "0.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16"
-dependencies = [
- "unicode-width",
-]
-
-[[package]]
name = "thiserror"
version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 89acaf4f8..3f95317c0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,7 +23,7 @@ license = "ISC"
readme = "README.md"
repository = "https://github.com/starship/starship"
# Note: MSRV is only intended as a hint, and only the latest version is officially supported in starship.
-rust-version = "1.59"
+rust-version = "1.60"
description = """
The minimal, blazing-fast, and infinitely customizable prompt for any shell! ☄🌌️
"""
@@ -36,8 +36,8 @@ notify = ["notify-rust"]
[dependencies]
chrono = { version = "0.4.22", features = ["clock", "std"] }
-clap = { version = "=3.2.22", features = ["derive", "cargo", "unicode", "unstable-v4"] }
-clap_complete = "3.2.5"
+clap = { version = "4.0.2", features = ["derive", "cargo", "unicode"] }
+clap_complete = "4.0.1"
dirs-next = "2.0.0"
dunce = "1.0.2"
gethostname = "0.2.3"
diff --git a/src/main.rs b/src/main.rs
index 7ffb15887..80830f985 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -5,7 +5,7 @@ use std::io;
use std::thread::available_parallelism;
use std::time::SystemTime;
-use clap::{IntoApp, Parser, Subcommand};
+use clap::{CommandFactory, Parser, Subcommand};
use clap_complete::{generate, Shell as CompletionShell};
use rand::distributions::Alphanumeric;
use rand::Rng;
@@ -33,7 +33,7 @@ enum Commands {
BugReport,
/// Generate starship shell completions for your shell to stdout
Completions {
- #[clap(arg_enum)]
+ #[clap(value_enum)]
shell: CompletionShell,
},
/// Edit the starship configuration
diff --git a/src/print.rs b/src/print.rs
index aed249d91..6bb1f1be7 100644
--- a/src/print.rs
+++ b/src/print.rs
@@ -1,4 +1,4 @@
-use clap::{PossibleValue, ValueEnum};
+use clap::{builder::PossibleValue, ValueEnum};
use nu_ansi_term::AnsiStrings;
use rayon::prelude::*;
use std::collections::BTreeSet;
@@ -460,7 +460,7 @@ impl ValueEnum for Preset {
shadow::get_preset_list()
}
- fn to_possible_value<'a>(&self) -> Option<clap::PossibleValue<'a>> {
+ fn to_possible_value(&self) -> Option<PossibleValue> {
Some(PossibleValue::new(self.0))
}
}