about summary refs log tree commit diff
path: root/tvix/nix_cli
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-12-16T11·54+0300
committertazjin <tazjin@tvl.su>2022-12-21T13·23+0000
commit257c67f204c2a2d1ca8a1d0ac266312167a170eb (patch)
tree2cd7f15cb4f47a0083c273ab1b0b7ff8f9a5f688 /tvix/nix_cli
parentd9e2bec953880ecb5953b61b36a5beaec0565e22 (diff)
chore(tvix): upgrade to clap 4.0 r/5441
In //tvix/eval:

* criterion bumped to 4.0, which at least depends on clap 3.x instead
  of 2.x, which is less incompatible

In //tvix/cli:

* no changes required

In //tvix/nix_cli:

* some minor changes for compatibility with clap 4.0, no functionality
  changes

Change-Id: If793f64b59fcaa2402d3d483ddbab4092f32df03
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7588
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/nix_cli')
-rw-r--r--tvix/nix_cli/Cargo.toml3
-rw-r--r--tvix/nix_cli/src/bin/nix-store.rs8
2 files changed, 6 insertions, 5 deletions
diff --git a/tvix/nix_cli/Cargo.toml b/tvix/nix_cli/Cargo.toml
index c0b85e56b89e..f9de2b97706b 100644
--- a/tvix/nix_cli/Cargo.toml
+++ b/tvix/nix_cli/Cargo.toml
@@ -6,7 +6,8 @@ edition = "2021"
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
 [dependencies.clap]
-version = "3.0.5"
+version = "4.0"
+
 [dependencies.tempfile]
 version = "3.2.0"
 
diff --git a/tvix/nix_cli/src/bin/nix-store.rs b/tvix/nix_cli/src/bin/nix-store.rs
index 8d008a414dc4..c6f7d00a4df8 100644
--- a/tvix/nix_cli/src/bin/nix-store.rs
+++ b/tvix/nix_cli/src/bin/nix-store.rs
@@ -2,12 +2,12 @@ fn main() {
     main_args(std::env::args().collect()).unwrap_or_else(|e| e.exit());
 }
 
-pub fn main_args(args: Vec<String>) -> clap::Result<NixResult> {
-    let matches = clap::App::new("nix-store")
-        .subcommand(clap::App::new("--add").arg(clap::Arg::new("FILE").required(true).index(1)))
+pub fn main_args(args: Vec<String>) -> clap::error::Result<NixResult> {
+    let matches = clap::Command::new("nix-store")
+        .subcommand(clap::Command::new("--add").arg(clap::Arg::new("FILE").required(true).index(1)))
         .try_get_matches_from(args.iter())?;
     if let Some(add) = matches.subcommand_matches("--add") {
-        let file = add.value_of("FILE").expect("--add needs a file");
+        let file = add.get_one::<String>("FILE").expect("--add needs a file");
         let file_contents =
             std::fs::read_to_string(file).expect(&format!("file {} does not exist", file));
         Ok(NixResult::FileAddedToStore {