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 = [
"atty",
"bitflags",
"clap_derive",
"clap_lex",
"clap_lex 0.2.4",
"indexmap",
"once_cell",
"strsim",
"termcolor",
"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]]
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",
"proc-macro-error",
@ -204,6 +217,15 @@ dependencies = [
"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]]
name = "console_error_panic_hook"
version = "0.1.7"
@ -809,7 +831,7 @@ dependencies = [
name = "oxigraph_server"
version = "0.3.6"
dependencies = [
"clap 3.2.22",
"clap 4.0.2",
"flate2",
"oxhttp",
"oxigraph",
@ -825,7 +847,7 @@ name = "oxigraph_testsuite"
version = "0.3.6"
dependencies = [
"anyhow",
"clap 3.2.22",
"clap 4.0.2",
"criterion",
"oxigraph",
"text-diff",

@ -13,7 +13,7 @@ edition = "2021"
[dependencies]
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"] }
sparesults = { version = "0.1.1", path = "../lib/sparesults", features = ["rdf-star"] }
rand = "0.8"

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

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

Loading…
Cancel
Save