Upgrades clap to v4

pull/255/head
Tpt 2 years ago committed by Thomas Tanon
parent c1d2cf030d
commit f5b73f842e
  1. 36
      Cargo.lock
  2. 2
      server/Cargo.toml
  3. 14
      server/src/main.rs
  4. 2
      testsuite/Cargo.toml

36
Cargo.lock generated

@ -173,20 +173,33 @@ checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750"
dependencies = [ dependencies = [
"atty", "atty",
"bitflags", "bitflags",
"clap_derive", "clap_lex 0.2.4",
"clap_lex",
"indexmap", "indexmap",
"once_cell",
"strsim", "strsim",
"termcolor", "termcolor",
"textwrap 0.15.1", "textwrap 0.15.1",
] ]
[[package]]
name = "clap"
version = "4.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31c9484ccdc4cb8e7b117cbd0eb150c7c0f04464854e4679aeb50ef03b32d003"
dependencies = [
"atty",
"bitflags",
"clap_derive",
"clap_lex 0.3.0",
"once_cell",
"strsim",
"termcolor",
]
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "3.2.18" version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" checksum = "ca689d7434ce44517a12a89456b2be4d1ea1cafcd8f581978c03d45f5a5c12a7"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro-error", "proc-macro-error",
@ -204,6 +217,15 @@ dependencies = [
"os_str_bytes", "os_str_bytes",
] ]
[[package]]
name = "clap_lex"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8"
dependencies = [
"os_str_bytes",
]
[[package]] [[package]]
name = "console_error_panic_hook" name = "console_error_panic_hook"
version = "0.1.7" version = "0.1.7"
@ -809,7 +831,7 @@ dependencies = [
name = "oxigraph_server" name = "oxigraph_server"
version = "0.3.6" version = "0.3.6"
dependencies = [ dependencies = [
"clap 3.2.22", "clap 4.0.2",
"flate2", "flate2",
"oxhttp", "oxhttp",
"oxigraph", "oxigraph",
@ -825,7 +847,7 @@ name = "oxigraph_testsuite"
version = "0.3.6" version = "0.3.6"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap 3.2.22", "clap 4.0.2",
"criterion", "criterion",
"oxigraph", "oxigraph",
"text-diff", "text-diff",

@ -13,7 +13,7 @@ edition = "2021"
[dependencies] [dependencies]
oxhttp = { version = "0.1", features = ["rayon"] } oxhttp = { version = "0.1", features = ["rayon"] }
clap = { version = "3", features = ["derive"] } clap = { version = "4", features = ["derive"] }
oxigraph = { version = "0.3.6", path = "../lib", features = ["http_client"] } oxigraph = { version = "0.3.6", path = "../lib", features = ["http_client"] }
sparesults = { version = "0.1.1", path = "../lib/sparesults", features = ["rdf-star"] } sparesults = { version = "0.1.1", path = "../lib/sparesults", features = ["rdf-star"] }
rand = "0.8" rand = "0.8"

@ -28,13 +28,13 @@ const HTML_ROOT_PAGE: &str = include_str!("../templates/query.html");
const LOGO: &str = include_str!("../logo.svg"); const LOGO: &str = include_str!("../logo.svg");
#[derive(Parser)] #[derive(Parser)]
#[clap(about, version)] #[command(about, version)]
/// Oxigraph SPARQL server. /// Oxigraph SPARQL server.
struct Args { struct Args {
/// Directory in which persist the data. /// Directory in which persist the data.
#[clap(short, long, parse(from_os_str), global = true)] #[arg(short, long, global = true)]
location: Option<PathBuf>, location: Option<PathBuf>,
#[clap(subcommand)] #[command(subcommand)]
command: Command, command: Command,
} }
@ -43,7 +43,7 @@ enum Command {
/// Start Oxigraph HTTP server. /// Start Oxigraph HTTP server.
Serve { Serve {
/// Host and port to listen to. /// Host and port to listen to.
#[clap(short, long, default_value = "localhost:7878", global = true)] #[arg(short, long, default_value = "localhost:7878", global = true)]
bind: String, bind: String,
}, },
/// Load file(s) into the store. /// Load file(s) into the store.
@ -51,12 +51,12 @@ enum Command {
/// file(s) to load. /// file(s) to load.
/// ///
/// If multiple files are provided they are loaded in parallel. /// If multiple files are provided they are loaded in parallel.
#[clap(short, long, global = true, multiple_values = true)] #[arg(short, long, global = true, num_args = 0..)]
file: Vec<String>, file: Vec<String>,
/// Attempt to keep loading even if the data file is invalid. /// Attempt to keep loading even if the data file is invalid.
/// ///
/// Only works with N-Triples and N-Quads for now. /// Only works with N-Triples and N-Quads for now.
#[clap(long, global = true)] #[arg(long, global = true)]
lenient: bool, lenient: bool,
}, },
} }
@ -1687,7 +1687,7 @@ mod tests {
#[test] #[test]
fn clap_debug() { fn clap_debug() {
use clap::IntoApp; use clap::CommandFactory;
Args::command().debug_assert() Args::command().debug_assert()
} }

@ -13,7 +13,7 @@ publish = false
[dependencies] [dependencies]
anyhow = "1" anyhow = "1"
clap = { version = "3", features = ["derive"] } clap = { version = "4", features = ["derive"] }
time = { version = "0.3", features = ["formatting"] } time = { version = "0.3", features = ["formatting"] }
oxigraph = { version = "0.3.6", path="../lib" } oxigraph = { version = "0.3.6", path="../lib" }
text-diff = "0.4" text-diff = "0.4"

Loading…
Cancel
Save