From 54a12e81783a5ae4d68e1970df75f5e99dee9fd1 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Sat, 22 Oct 2022 23:27:04 +0800 Subject: [PATCH 01/42] chore: release 0.1.0 --- .github/workflows/ci.yaml | 38 ++++++++++++ .gitignore | 2 + Cargo.toml | 26 ++++++++ LICENSE | 21 +++++++ README.md | 97 ++++++++++++++++++++++++++++++ examples/nushell_completion.rs | 12 ++++ src/lib.rs | 95 +++++++++++++++++++++++++++++ tests/common.rs | 82 +++++++++++++++++++++++++ tests/nushell.rs | 37 ++++++++++++ tests/snapshots/basic.nu | 16 +++++ tests/snapshots/feature_sample.nu | 19 ++++++ tests/snapshots/sub_subcommands.nu | 30 +++++++++ 12 files changed, 475 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 examples/nushell_completion.rs create mode 100644 src/lib.rs create mode 100644 tests/common.rs create mode 100644 tests/nushell.rs create mode 100644 tests/snapshots/basic.nu create mode 100644 tests/snapshots/feature_sample.nu create mode 100644 tests/snapshots/sub_subcommands.nu diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000000..d1f91843c44 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,38 @@ +name: CI +on: [push, pull_request] + +jobs: + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + build: [stable, beta, nightly] + include: + - build: stable + os: ubuntu-latest + rust: stable + - build: beta + os: ubuntu-latest + rust: beta + - build: nightly + os: ubuntu-latest + rust: nightly + steps: + - uses: actions/checkout@master + - name: Install Rust (rustup) + run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} + shell: bash + - run: cargo build --examples -v --workspace + - run: cargo doc -v --workspace + - run: cargo test -v --workspace + - run: cargo clean + + rustfmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Install Rust + run: rustup update stable && rustup default stable && rustup component add rustfmt + - run: cargo fmt -- --check diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..4fffb2f89cb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +/Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000000..288f9f18644 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "clap_complete_nushell" +authors = [ "nibon7 " ] +version = "0.1.0" +edition = "2021" +license = "MIT" +description = "A generator library used with clap for Nushell completion scripts" +repository = "https://github.com/nibon7/clap_complete_nushell" +readme = "./README.md" +categories = ["command-line-interface"] +keywords = [ + "clap", + "cli", + "completion", + "nushell" +] +exclude = [ "tests/*" ] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +clap = { version = "4.0", default-features = false } +clap_complete = "4.0" + +[dev-dependencies] +snapbox = { version = "0.4", features = ["diff"] } diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000000..551d7931cf9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 nibon7 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 00000000000..7caa10489d6 --- /dev/null +++ b/README.md @@ -0,0 +1,97 @@ +# clap_complete_nushell + +Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`](https://github.com/clap-rs/clap) based CLIs + +## Examples + +### myapp.rs + +```rust +use clap::{Arg, ArgAction, Command}; +use clap_complete::generate; +use clap_complete_nushell::Nushell; +use std::io; + +fn main() { + let mut cmd = Command::new("myapp") + .version("3.0") + .propagate_version(true) + .about("Tests completions") + .arg( + Arg::new("file") + .value_hint(clap::ValueHint::FilePath) + .help("some input file"), + ) + .arg( + Arg::new("config") + .action(ArgAction::Count) + .help("some config file") + .short('c') + .visible_short_alias('C') + .long("config") + .visible_alias("conf"), + ) + .arg(Arg::new("choice").value_parser(["first", "second"])) + .subcommand( + Command::new("test").about("tests things").arg( + Arg::new("case") + .long("case") + .action(ArgAction::Set) + .help("the case to test"), + ), + ) + .subcommand( + Command::new("some_cmd") + .about("top level subcommand") + .subcommand( + Command::new("sub_cmd").about("sub-subcommand").arg( + Arg::new("config") + .long("config") + .action(ArgAction::Set) + .value_parser([clap::builder::PossibleValue::new( + "Lest quotes aren't escaped.", + )]) + .help("the other case to test"), + ), + ), + ); + + generate(Nushell, &mut cmd, "myapp", &mut io::stdout()); +} +``` + + +### myapp.nu + +```nu +module completions { + + # Tests completions + export extern myapp [ + file?: string # some input file + --config(-c) # some config file + choice?: string + --version(-V) # Print version information + ] + + # tests things + export extern "myapp test" [ + --case: string # the case to test + --version(-V) # Print version information + ] + + # top level subcommand + export extern "myapp some_cmd" [ + --version(-V) # Print version information + ] + + # sub-subcommand + export extern "myapp some_cmd sub_cmd" [ + --config: string # the other case to test + --version(-V) # Print version information + ] + +} + +use completions * +``` diff --git a/examples/nushell_completion.rs b/examples/nushell_completion.rs new file mode 100644 index 00000000000..e63f9314362 --- /dev/null +++ b/examples/nushell_completion.rs @@ -0,0 +1,12 @@ +use clap::Command; +use clap_complete::generate; +use clap_complete_nushell::Nushell; +use std::io; + +fn main() { + let mut cmd = Command::new("myapp") + .subcommand(Command::new("test").subcommand(Command::new("config"))) + .subcommand(Command::new("hello")); + + generate(Nushell, &mut cmd, "myapp", &mut io::stdout()); +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 00000000000..dfd801408a5 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,95 @@ +//! Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`](https://github.com/clap-rs/clap) based CLIs + +use clap::Command; +use clap_complete::Generator; + +/// Generate Nushell complete file +pub struct Nushell; + +impl Generator for Nushell { + fn file_name(&self, name: &str) -> String { + format!("{}.nu", name) + } + + fn generate(&self, cmd: &Command, buf: &mut dyn std::io::Write) { + let mut completions = String::new(); + + completions.push_str("module completions {\n\n"); + + generate_completion(&mut completions, cmd, false); + + for sub in cmd.get_subcommands() { + generate_completion(&mut completions, sub, true); + } + + completions.push_str("}\n\n"); + completions.push_str("use completions *\n"); + + buf.write_all(completions.as_bytes()) + .expect("Failed to write to generated file") + } +} + +fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: bool) { + if let Some(about) = cmd.get_about() { + completions.push_str(format!(" # {}\n", about).as_str()); + } + + let bin_name = cmd.get_bin_name().expect("Failed to get bin name"); + + if is_subcommand { + completions.push_str(format!(" export extern \"{}\" [\n", bin_name).as_str()); + } else { + completions.push_str(format!(" export extern {} [\n", bin_name).as_str()); + } + + let mut s = String::new(); + for arg in cmd.get_arguments() { + if arg.is_positional() { + s.push_str(format!(" {}", arg.get_id()).as_str()); + if !arg.is_required_set() { + s.push('?'); + } + } + + let long = arg.get_long(); + if let Some(opt) = long { + s.push_str(format!(" --{}", opt).as_str()); + } + + let short = arg.get_short(); + if let Some(opt) = short { + if long.is_some() { + s.push_str(format!("(-{})", opt).as_str()); + } else { + s.push_str(format!(" -{}", opt).as_str()); + } + } + + if let Some(v) = arg.get_num_args() { + if v.takes_values() { + // TODO: add more types? + // TODO: add possible values? + s.push_str(": string"); + } + } + + if let Some(msg) = arg.get_help() { + if arg.is_positional() || long.is_some() || short.is_some() { + s.push_str(format!("\t# {}", msg).as_str()); + } + } + + s.push('\n'); + } + + completions.push_str(&s); + completions.push_str(" ]\n\n"); + + // For sub-subcommands + if is_subcommand { + for sub in cmd.get_subcommands() { + generate_completion(completions, sub, true); + } + } +} diff --git a/tests/common.rs b/tests/common.rs new file mode 100644 index 00000000000..a2f18a99d2b --- /dev/null +++ b/tests/common.rs @@ -0,0 +1,82 @@ +use clap::{builder::PossibleValue, Arg, ArgAction, Command, ValueHint}; + +pub fn basic_command(name: &'static str) -> Command { + Command::new(name) + .arg( + Arg::new("config") + .short('c') + .global(true) + .action(ArgAction::SetTrue), + ) + .arg( + Arg::new("v") + .short('v') + .conflicts_with("config") + .action(ArgAction::SetTrue), + ) + .subcommand( + Command::new("test") + .about("Subcommand") + .arg(Arg::new("debug").short('d').action(ArgAction::Count)), + ) +} + +pub fn feature_sample_command(name: &'static str) -> Command { + Command::new(name) + .version("3.0") + .propagate_version(true) + .about("Tests completions") + .arg( + Arg::new("file") + .value_hint(ValueHint::FilePath) + .help("some input file"), + ) + .arg( + Arg::new("config") + .action(ArgAction::Count) + .help("some config file") + .short('c') + .visible_short_alias('C') + .long("config") + .visible_alias("conf"), + ) + .arg(Arg::new("choice").value_parser(["first", "second"])) + .subcommand( + Command::new("test").about("tests things").arg( + Arg::new("case") + .long("case") + .action(ArgAction::Set) + .help("the case to test"), + ), + ) +} + +pub fn sub_subcommands_command(name: &'static str) -> Command { + feature_sample_command(name).subcommand( + Command::new("some_cmd") + .about("top level subcommand") + .subcommand( + Command::new("sub_cmd").about("sub-subcommand").arg( + Arg::new("config") + .long("config") + .action(ArgAction::Set) + .value_parser([PossibleValue::new("Lest quotes aren't escaped.")]) + .help("the other case to test"), + ), + ), + ) +} + +pub fn assert_matches_path( + expected_path: impl AsRef, + gen: impl clap_complete::Generator, + mut cmd: Command, + name: &'static str, +) { + let mut buf = vec![]; + clap_complete::generate(gen, &mut cmd, name, &mut buf); + + snapbox::Assert::new() + .action_env("SNAPSHOTS") + .matches_path(expected_path, buf); +} diff --git a/tests/nushell.rs b/tests/nushell.rs new file mode 100644 index 00000000000..0a9de76cfe0 --- /dev/null +++ b/tests/nushell.rs @@ -0,0 +1,37 @@ +mod common; + +#[test] +fn basic() { + let name = "my-app"; + let cmd = common::basic_command(name); + common::assert_matches_path( + "tests/snapshots/basic.nu", + clap_complete_nushell::Nushell, + cmd, + name, + ); +} + +#[test] +fn feature_sample() { + let name = "my-app"; + let cmd = common::feature_sample_command(name); + common::assert_matches_path( + "tests/snapshots/feature_sample.nu", + clap_complete_nushell::Nushell, + cmd, + name, + ); +} + +#[test] +fn sub_subcommands() { + let name = "my-app"; + let cmd = common::sub_subcommands_command(name); + common::assert_matches_path( + "tests/snapshots/sub_subcommands.nu", + clap_complete_nushell::Nushell, + cmd, + name, + ); +} diff --git a/tests/snapshots/basic.nu b/tests/snapshots/basic.nu new file mode 100644 index 00000000000..9e4b07e9888 --- /dev/null +++ b/tests/snapshots/basic.nu @@ -0,0 +1,16 @@ +module completions { + + export extern my-app [ + -c + -v + ] + + # Subcommand + export extern "my-app test" [ + -d + -c + ] + +} + +use completions * diff --git a/tests/snapshots/feature_sample.nu b/tests/snapshots/feature_sample.nu new file mode 100644 index 00000000000..9cedae9cd73 --- /dev/null +++ b/tests/snapshots/feature_sample.nu @@ -0,0 +1,19 @@ +module completions { + + # Tests completions + export extern my-app [ + file?: string # some input file + --config(-c) # some config file + choice?: string + --version(-V) # Print version information + ] + + # tests things + export extern "my-app test" [ + --case: string # the case to test + --version(-V) # Print version information + ] + +} + +use completions * diff --git a/tests/snapshots/sub_subcommands.nu b/tests/snapshots/sub_subcommands.nu new file mode 100644 index 00000000000..445a1f21490 --- /dev/null +++ b/tests/snapshots/sub_subcommands.nu @@ -0,0 +1,30 @@ +module completions { + + # Tests completions + export extern my-app [ + file?: string # some input file + --config(-c) # some config file + choice?: string + --version(-V) # Print version information + ] + + # tests things + export extern "my-app test" [ + --case: string # the case to test + --version(-V) # Print version information + ] + + # top level subcommand + export extern "my-app some_cmd" [ + --version(-V) # Print version information + ] + + # sub-subcommand + export extern "my-app some_cmd sub_cmd" [ + --config: string # the other case to test + --version(-V) # Print version information + ] + +} + +use completions * From f1bc5a554af4e617c7d7508f7f16f8fd25c78c91 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Mon, 31 Oct 2022 12:45:22 +0800 Subject: [PATCH 02/42] refactor: refactor generate_completion --- src/lib.rs | 148 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 105 insertions(+), 43 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index dfd801408a5..15850f7f6d7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,11 +1,106 @@ //! Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`](https://github.com/clap-rs/clap) based CLIs -use clap::Command; +use clap::{Arg, Command}; use clap_complete::Generator; /// Generate Nushell complete file pub struct Nushell; +enum Argument { + Short(char), + Long(String), + ShortAndLong(char, String), + Positional(String, bool), +} + +struct ArgumentLine { + arg: Argument, + takes_values: bool, + help: Option, +} + +impl From<&Arg> for ArgumentLine { + fn from(arg: &Arg) -> Self { + let takes_values = arg + .get_num_args() + .map(|v| v.takes_values()) + .unwrap_or(false); + + let help = arg.get_help().map(|s| s.to_string()); + + if arg.is_positional() { + let id = arg.get_id().to_string(); + let required = arg.is_required_set(); + let arg = Argument::Positional(id, required); + + return Self { + arg, + takes_values, + help, + }; + } + + let short = arg.get_short(); + let long = arg.get_long(); + + match short { + Some(short) => match long { + Some(long) => Self { + arg: Argument::ShortAndLong(short, long.into()), + takes_values, + help, + }, + None => Self { + arg: Argument::Short(short), + takes_values, + help, + }, + }, + None => match long { + Some(long) => Self { + arg: Argument::Long(long.into()), + takes_values, + help, + }, + None => unreachable!("No short or long option found"), + }, + } + } +} + +impl ToString for ArgumentLine { + fn to_string(&self) -> String { + let mut s = String::new(); + + match &self.arg { + Argument::Short(short) => s.push_str(format!(" -{}", short).as_str()), + Argument::Long(long) => s.push_str(format!(" --{}", long).as_str()), + Argument::ShortAndLong(short, long) => { + s.push_str(format!(" --{}(-{})", long, short).as_str()) + } + Argument::Positional(positional, required) => { + s.push_str(format!(" {}", positional).as_str()); + + if !*required { + s.push('?'); + } + } + } + + if self.takes_values { + s.push_str(": string"); + } + + if let Some(help) = &self.help { + s.push_str(format!("\t# {}", help).as_str()); + } + + s.push('\n'); + + s + } +} + impl Generator for Nushell { fn file_name(&self, name: &str) -> String { format!("{}.nu", name) @@ -37,51 +132,18 @@ fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: b let bin_name = cmd.get_bin_name().expect("Failed to get bin name"); - if is_subcommand { - completions.push_str(format!(" export extern \"{}\" [\n", bin_name).as_str()); + let name = if is_subcommand { + format!(r#""{}""#, bin_name) } else { - completions.push_str(format!(" export extern {} [\n", bin_name).as_str()); - } + bin_name.into() + }; - let mut s = String::new(); - for arg in cmd.get_arguments() { - if arg.is_positional() { - s.push_str(format!(" {}", arg.get_id()).as_str()); - if !arg.is_required_set() { - s.push('?'); - } - } - - let long = arg.get_long(); - if let Some(opt) = long { - s.push_str(format!(" --{}", opt).as_str()); - } + completions.push_str(format!(" export extern {} [\n", name).as_str()); - let short = arg.get_short(); - if let Some(opt) = short { - if long.is_some() { - s.push_str(format!("(-{})", opt).as_str()); - } else { - s.push_str(format!(" -{}", opt).as_str()); - } - } - - if let Some(v) = arg.get_num_args() { - if v.takes_values() { - // TODO: add more types? - // TODO: add possible values? - s.push_str(": string"); - } - } - - if let Some(msg) = arg.get_help() { - if arg.is_positional() || long.is_some() || short.is_some() { - s.push_str(format!("\t# {}", msg).as_str()); - } - } - - s.push('\n'); - } + let s: String = cmd + .get_arguments() + .map(|arg| ArgumentLine::from(arg).to_string()) + .collect(); completions.push_str(&s); completions.push_str(" ]\n\n"); From 3d9b50513bc35d6e2254e2868008e1d3355f74a2 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Mon, 31 Oct 2022 18:32:40 +0800 Subject: [PATCH 03/42] feat: add alias completion --- README.md | 2 + src/lib.rs | 91 +++++++++++++++++++++--------- tests/common.rs | 25 ++++++++ tests/nushell.rs | 12 ++++ tests/snapshots/aliases.nu | 17 ++++++ tests/snapshots/feature_sample.nu | 2 + tests/snapshots/sub_subcommands.nu | 2 + 7 files changed, 125 insertions(+), 26 deletions(-) create mode 100644 tests/snapshots/aliases.nu diff --git a/README.md b/README.md index 7caa10489d6..8ca183ac625 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,8 @@ module completions { export extern myapp [ file?: string # some input file --config(-c) # some config file + --conf # some config file + -C # some config file choice?: string --version(-V) # Print version information ] diff --git a/src/lib.rs b/src/lib.rs index 15850f7f6d7..834af15f53d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,9 +7,9 @@ use clap_complete::Generator; pub struct Nushell; enum Argument { - Short(char), - Long(String), - ShortAndLong(char, String), + Short(Vec), + Long(Vec), + ShortAndLong(Vec, Vec), Positional(String, bool), } @@ -19,6 +19,20 @@ struct ArgumentLine { help: Option, } +impl ArgumentLine { + fn append_type_and_help(&self, s: &mut String) { + if self.takes_values { + s.push_str(": string"); + } + + if let Some(help) = &self.help { + s.push_str(format!("\t# {}", help).as_str()); + } + + s.push('\n'); + } +} + impl From<&Arg> for ArgumentLine { fn from(arg: &Arg) -> Self { let takes_values = arg @@ -40,25 +54,28 @@ impl From<&Arg> for ArgumentLine { }; } - let short = arg.get_short(); - let long = arg.get_long(); + let shorts = arg.get_short_and_visible_aliases(); + let longs = arg.get_long_and_visible_aliases(); - match short { - Some(short) => match long { - Some(long) => Self { - arg: Argument::ShortAndLong(short, long.into()), + match shorts { + Some(shorts) => match longs { + Some(longs) => Self { + arg: Argument::ShortAndLong( + shorts, + longs.iter().map(|s| s.to_string()).collect(), + ), takes_values, help, }, None => Self { - arg: Argument::Short(short), + arg: Argument::Short(shorts), takes_values, help, }, }, - None => match long { + None => match longs { Some(long) => Self { - arg: Argument::Long(long.into()), + arg: Argument::Long(long.iter().map(|s| s.to_string()).collect()), takes_values, help, }, @@ -73,10 +90,40 @@ impl ToString for ArgumentLine { let mut s = String::new(); match &self.arg { - Argument::Short(short) => s.push_str(format!(" -{}", short).as_str()), - Argument::Long(long) => s.push_str(format!(" --{}", long).as_str()), - Argument::ShortAndLong(short, long) => { - s.push_str(format!(" --{}(-{})", long, short).as_str()) + Argument::Short(shorts) => { + for short in shorts { + s.push_str(format!(" -{}", short).as_str()); + self.append_type_and_help(&mut s); + } + } + Argument::Long(longs) => { + for long in longs { + s.push_str(format!(" --{}", long).as_str()); + self.append_type_and_help(&mut s); + } + } + Argument::ShortAndLong(shorts, longs) => { + s.push_str( + format!( + " --{}(-{})", + longs.first().expect("At least one long option expected"), + shorts.first().expect("At lease one short option expected") + ) + .as_str(), + ); + self.append_type_and_help(&mut s); + + // long alias + for long in longs.iter().skip(1) { + s.push_str(format!(" --{}", long).as_str()); + self.append_type_and_help(&mut s); + } + + // short alias + for short in shorts.iter().skip(1) { + s.push_str(format!(" -{}", short).as_str()); + self.append_type_and_help(&mut s); + } } Argument::Positional(positional, required) => { s.push_str(format!(" {}", positional).as_str()); @@ -84,19 +131,11 @@ impl ToString for ArgumentLine { if !*required { s.push('?'); } - } - } - if self.takes_values { - s.push_str(": string"); - } - - if let Some(help) = &self.help { - s.push_str(format!("\t# {}", help).as_str()); + self.append_type_and_help(&mut s); + } } - s.push('\n'); - s } } diff --git a/tests/common.rs b/tests/common.rs index a2f18a99d2b..a52cface535 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -51,6 +51,31 @@ pub fn feature_sample_command(name: &'static str) -> Command { ) } +pub fn aliases_command(name: &'static str) -> Command { + Command::new(name) + .version("3.0") + .about("testing nushell completions") + .arg( + Arg::new("flag") + .short('f') + .visible_short_alias('F') + .long("flag") + .action(ArgAction::SetTrue) + .visible_alias("flg") + .help("cmd flag"), + ) + .arg( + Arg::new("option") + .short('o') + .visible_short_alias('O') + .long("option") + .visible_alias("opt") + .help("cmd option") + .action(ArgAction::Set), + ) + .arg(Arg::new("positional")) +} + pub fn sub_subcommands_command(name: &'static str) -> Command { feature_sample_command(name).subcommand( Command::new("some_cmd") diff --git a/tests/nushell.rs b/tests/nushell.rs index 0a9de76cfe0..528918639d7 100644 --- a/tests/nushell.rs +++ b/tests/nushell.rs @@ -24,6 +24,18 @@ fn feature_sample() { ); } +#[test] +fn aliases() { + let name = "my-app"; + let cmd = common::aliases_command(name); + common::assert_matches_path( + "tests/snapshots/aliases.nu", + clap_complete_nushell::Nushell, + cmd, + name, + ); +} + #[test] fn sub_subcommands() { let name = "my-app"; diff --git a/tests/snapshots/aliases.nu b/tests/snapshots/aliases.nu new file mode 100644 index 00000000000..1a7d9314363 --- /dev/null +++ b/tests/snapshots/aliases.nu @@ -0,0 +1,17 @@ +module completions { + + # testing nushell completions + export extern my-app [ + --flag(-f) # cmd flag + --flg # cmd flag + -F # cmd flag + --option(-o): string # cmd option + --opt: string # cmd option + -O: string # cmd option + positional?: string + --version(-V) # Print version information + ] + +} + +use completions * diff --git a/tests/snapshots/feature_sample.nu b/tests/snapshots/feature_sample.nu index 9cedae9cd73..54e50c1ab26 100644 --- a/tests/snapshots/feature_sample.nu +++ b/tests/snapshots/feature_sample.nu @@ -4,6 +4,8 @@ module completions { export extern my-app [ file?: string # some input file --config(-c) # some config file + --conf # some config file + -C # some config file choice?: string --version(-V) # Print version information ] diff --git a/tests/snapshots/sub_subcommands.nu b/tests/snapshots/sub_subcommands.nu index 445a1f21490..dbcfc905012 100644 --- a/tests/snapshots/sub_subcommands.nu +++ b/tests/snapshots/sub_subcommands.nu @@ -4,6 +4,8 @@ module completions { export extern my-app [ file?: string # some input file --config(-c) # some config file + --conf # some config file + -C # some config file choice?: string --version(-V) # Print version information ] From 07dbefef3f99306bc33a554f654e98ec8168e73c Mon Sep 17 00:00:00 2001 From: nibon7 Date: Mon, 31 Oct 2022 18:56:28 +0800 Subject: [PATCH 04/42] chore: release 0.1.1 --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 288f9f18644..86a9bfd9271 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,11 @@ [package] name = "clap_complete_nushell" authors = [ "nibon7 " ] -version = "0.1.0" +version = "0.1.1" edition = "2021" license = "MIT" description = "A generator library used with clap for Nushell completion scripts" +homepage = "https://github.com/nibon7/clap_complete_nushell" repository = "https://github.com/nibon7/clap_complete_nushell" readme = "./README.md" categories = ["command-line-interface"] From 547bd288bf0aa1261687834e4a44cc14af8ba6a7 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Mon, 31 Oct 2022 20:11:01 +0800 Subject: [PATCH 05/42] feat: add value completion --- README.md | 12 ++- src/lib.rs | 99 ++++++++++++++++++------- tests/common.rs | 111 +++++++++++++++++++++++++++- tests/nushell.rs | 24 ++++++ tests/snapshots/feature_sample.nu | 6 +- tests/snapshots/special_commands.nu | 40 ++++++++++ tests/snapshots/sub_subcommands.nu | 12 ++- tests/snapshots/value_hint.nu | 26 +++++++ 8 files changed, 297 insertions(+), 33 deletions(-) create mode 100644 tests/snapshots/special_commands.nu create mode 100644 tests/snapshots/value_hint.nu diff --git a/README.md b/README.md index 8ca183ac625..04645228bee 100644 --- a/README.md +++ b/README.md @@ -66,13 +66,17 @@ fn main() { ```nu module completions { + def "myapp choice" [] { + [ "first" "second" ] + } + # Tests completions export extern myapp [ file?: string # some input file --config(-c) # some config file --conf # some config file -C # some config file - choice?: string + choice?: string@"myapp choice" --version(-V) # Print version information ] @@ -87,9 +91,13 @@ module completions { --version(-V) # Print version information ] + def "myapp some_cmd sub_cmd config" [] { + [ "Lest quotes aren't escaped." ] + } + # sub-subcommand export extern "myapp some_cmd sub_cmd" [ - --config: string # the other case to test + --config: string@"myapp some_cmd sub_cmd config" # the other case to test --version(-V) # Print version information ] diff --git a/src/lib.rs b/src/lib.rs index 834af15f53d..3ca2d8697a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ //! Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`](https://github.com/clap-rs/clap) based CLIs -use clap::{Arg, Command}; +use clap::{builder::PossibleValue, Arg, Command}; use clap_complete::Generator; /// Generate Nushell complete file @@ -10,46 +10,42 @@ enum Argument { Short(Vec), Long(Vec), ShortAndLong(Vec, Vec), - Positional(String, bool), + Positional(bool), } struct ArgumentLine { + id: String, + name: String, arg: Argument, takes_values: bool, + possible_values: Vec, help: Option, } impl ArgumentLine { - fn append_type_and_help(&self, s: &mut String) { - if self.takes_values { - s.push_str(": string"); - } - - if let Some(help) = &self.help { - s.push_str(format!("\t# {}", help).as_str()); - } - - s.push('\n'); - } -} + fn new(arg: &Arg, bin_name: &str) -> Self { + let id = arg.get_id().to_string(); + let name = bin_name.to_string(); -impl From<&Arg> for ArgumentLine { - fn from(arg: &Arg) -> Self { let takes_values = arg .get_num_args() .map(|v| v.takes_values()) .unwrap_or(false); + let possible_values = arg.get_possible_values(); + let help = arg.get_help().map(|s| s.to_string()); if arg.is_positional() { - let id = arg.get_id().to_string(); let required = arg.is_required_set(); - let arg = Argument::Positional(id, required); + let arg = Argument::Positional(required); return Self { + id, + name, arg, takes_values, + possible_values, help, }; } @@ -60,29 +56,71 @@ impl From<&Arg> for ArgumentLine { match shorts { Some(shorts) => match longs { Some(longs) => Self { + id, + name, arg: Argument::ShortAndLong( shorts, longs.iter().map(|s| s.to_string()).collect(), ), takes_values, + possible_values, help, }, None => Self { + id, + name, arg: Argument::Short(shorts), takes_values, + possible_values, help, }, }, None => match longs { - Some(long) => Self { - arg: Argument::Long(long.iter().map(|s| s.to_string()).collect()), + Some(longs) => Self { + id, + name, + arg: Argument::Long(longs.iter().map(|s| s.to_string()).collect()), takes_values, + possible_values, help, }, None => unreachable!("No short or long option found"), }, } } + + fn generate_value_hints(&self) -> Option { + if self.possible_values.is_empty() { + return None; + } + + let mut s = format!(r#" def "{} {}" [] {{"#, self.name, self.id); + s.push_str("\n ["); + + for value in &self.possible_values { + s.push_str(format!(r#" "{}""#, value.get_name()).as_str()); + } + + s.push_str(" ]\n }\n\n"); + + Some(s) + } + + fn append_type_and_help(&self, s: &mut String) { + if self.takes_values { + s.push_str(": string"); + + if !self.possible_values.is_empty() { + s.push_str(format!(r#"@"{} {}""#, self.name, self.id).as_str()) + } + } + + if let Some(help) = &self.help { + s.push_str(format!("\t# {}", help).as_str()); + } + + s.push('\n'); + } } impl ToString for ArgumentLine { @@ -125,8 +163,8 @@ impl ToString for ArgumentLine { self.append_type_and_help(&mut s); } } - Argument::Positional(positional, required) => { - s.push_str(format!(" {}", positional).as_str()); + Argument::Positional(required) => { + s.push_str(format!(" {}", self.id).as_str()); if !*required { s.push('?'); @@ -165,23 +203,30 @@ impl Generator for Nushell { } fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: bool) { - if let Some(about) = cmd.get_about() { - completions.push_str(format!(" # {}\n", about).as_str()); - } - let bin_name = cmd.get_bin_name().expect("Failed to get bin name"); + for hint in cmd + .get_arguments() + .filter_map(|arg| ArgumentLine::new(arg, bin_name).generate_value_hints()) + { + completions.push_str(&hint); + } + let name = if is_subcommand { format!(r#""{}""#, bin_name) } else { bin_name.into() }; + if let Some(about) = cmd.get_about() { + completions.push_str(format!(" # {}\n", about).as_str()); + } + completions.push_str(format!(" export extern {} [\n", name).as_str()); let s: String = cmd .get_arguments() - .map(|arg| ArgumentLine::from(arg).to_string()) + .map(|arg| ArgumentLine::new(arg, bin_name).to_string()) .collect(); completions.push_str(&s); diff --git a/tests/common.rs b/tests/common.rs index a52cface535..ddaa1ad8b8c 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -51,6 +51,25 @@ pub fn feature_sample_command(name: &'static str) -> Command { ) } +pub fn special_commands_command(name: &'static str) -> clap::Command { + feature_sample_command(name) + .subcommand( + clap::Command::new("some_cmd") + .about("tests other things") + .arg( + clap::Arg::new("config") + .long("config") + .hide(true) + .action(clap::ArgAction::Set) + .require_equals(true) + .help("the other case to test"), + ) + .arg(clap::Arg::new("path").num_args(1..)), + ) + .subcommand(clap::Command::new("some-cmd-with-hyphens").alias("hyphen")) + .subcommand(clap::Command::new("some-hidden-cmd").hide(true)) +} + pub fn aliases_command(name: &'static str) -> Command { Command::new(name) .version("3.0") @@ -80,18 +99,107 @@ pub fn sub_subcommands_command(name: &'static str) -> Command { feature_sample_command(name).subcommand( Command::new("some_cmd") .about("top level subcommand") + .visible_alias("some_cmd_alias") .subcommand( Command::new("sub_cmd").about("sub-subcommand").arg( Arg::new("config") .long("config") .action(ArgAction::Set) - .value_parser([PossibleValue::new("Lest quotes aren't escaped.")]) + .value_parser([ + PossibleValue::new("Lest quotes, aren't escaped.") + .help("help,with,comma"), + PossibleValue::new("Second to trigger display of options"), + ]) .help("the other case to test"), ), ), ) } +pub fn value_hint_command(name: &'static str) -> clap::Command { + clap::Command::new(name) + .arg( + clap::Arg::new("choice") + .long("choice") + .action(clap::ArgAction::Set) + .value_parser(["bash", "fish", "zsh"]), + ) + .arg( + clap::Arg::new("unknown") + .long("unknown") + .value_hint(clap::ValueHint::Unknown), + ) + .arg( + clap::Arg::new("other") + .long("other") + .value_hint(clap::ValueHint::Other), + ) + .arg( + clap::Arg::new("path") + .long("path") + .short('p') + .value_hint(clap::ValueHint::AnyPath), + ) + .arg( + clap::Arg::new("file") + .long("file") + .short('f') + .value_hint(clap::ValueHint::FilePath), + ) + .arg( + clap::Arg::new("dir") + .long("dir") + .short('d') + .value_hint(clap::ValueHint::DirPath), + ) + .arg( + clap::Arg::new("exe") + .long("exe") + .short('e') + .value_hint(clap::ValueHint::ExecutablePath), + ) + .arg( + clap::Arg::new("cmd_name") + .long("cmd-name") + .value_hint(clap::ValueHint::CommandName), + ) + .arg( + clap::Arg::new("cmd") + .long("cmd") + .short('c') + .value_hint(clap::ValueHint::CommandString), + ) + .arg( + clap::Arg::new("command_with_args") + .action(clap::ArgAction::Set) + .num_args(1..) + .trailing_var_arg(true) + .value_hint(clap::ValueHint::CommandWithArguments), + ) + .arg( + clap::Arg::new("user") + .short('u') + .long("user") + .value_hint(clap::ValueHint::Username), + ) + .arg( + clap::Arg::new("host") + .short('H') + .long("host") + .value_hint(clap::ValueHint::Hostname), + ) + .arg( + clap::Arg::new("url") + .long("url") + .value_hint(clap::ValueHint::Url), + ) + .arg( + clap::Arg::new("email") + .long("email") + .value_hint(clap::ValueHint::EmailAddress), + ) +} + pub fn assert_matches_path( expected_path: impl AsRef, gen: impl clap_complete::Generator, @@ -103,5 +211,6 @@ pub fn assert_matches_path( snapbox::Assert::new() .action_env("SNAPSHOTS") + .normalize_paths(false) .matches_path(expected_path, buf); } diff --git a/tests/nushell.rs b/tests/nushell.rs index 528918639d7..acefc88563c 100644 --- a/tests/nushell.rs +++ b/tests/nushell.rs @@ -24,6 +24,18 @@ fn feature_sample() { ); } +#[test] +fn special_commands() { + let name = "my-app"; + let cmd = common::special_commands_command(name); + common::assert_matches_path( + "tests/snapshots/special_commands.nu", + clap_complete_nushell::Nushell, + cmd, + name, + ); +} + #[test] fn aliases() { let name = "my-app"; @@ -47,3 +59,15 @@ fn sub_subcommands() { name, ); } + +#[test] +fn value_hint() { + let name = "my-app"; + let cmd = common::value_hint_command(name); + common::assert_matches_path( + "tests/snapshots/value_hint.nu", + clap_complete_nushell::Nushell, + cmd, + name, + ); +} diff --git a/tests/snapshots/feature_sample.nu b/tests/snapshots/feature_sample.nu index 54e50c1ab26..cc9a3982235 100644 --- a/tests/snapshots/feature_sample.nu +++ b/tests/snapshots/feature_sample.nu @@ -1,12 +1,16 @@ module completions { + def "my-app choice" [] { + [ "first" "second" ] + } + # Tests completions export extern my-app [ file?: string # some input file --config(-c) # some config file --conf # some config file -C # some config file - choice?: string + choice?: string@"my-app choice" --version(-V) # Print version information ] diff --git a/tests/snapshots/special_commands.nu b/tests/snapshots/special_commands.nu new file mode 100644 index 00000000000..83d2b85295b --- /dev/null +++ b/tests/snapshots/special_commands.nu @@ -0,0 +1,40 @@ +module completions { + + def "my-app choice" [] { + [ "first" "second" ] + } + + # Tests completions + export extern my-app [ + file?: string # some input file + --config(-c) # some config file + --conf # some config file + -C # some config file + choice?: string@"my-app choice" + --version(-V) # Print version information + ] + + # tests things + export extern "my-app test" [ + --case: string # the case to test + --version(-V) # Print version information + ] + + # tests other things + export extern "my-app some_cmd" [ + --config: string # the other case to test + path?: string + --version(-V) # Print version information + ] + + export extern "my-app some-cmd-with-hyphens" [ + --version(-V) # Print version information + ] + + export extern "my-app some-hidden-cmd" [ + --version(-V) # Print version information + ] + +} + +use completions * diff --git a/tests/snapshots/sub_subcommands.nu b/tests/snapshots/sub_subcommands.nu index dbcfc905012..c30b553e75b 100644 --- a/tests/snapshots/sub_subcommands.nu +++ b/tests/snapshots/sub_subcommands.nu @@ -1,12 +1,16 @@ module completions { + def "my-app choice" [] { + [ "first" "second" ] + } + # Tests completions export extern my-app [ file?: string # some input file --config(-c) # some config file --conf # some config file -C # some config file - choice?: string + choice?: string@"my-app choice" --version(-V) # Print version information ] @@ -21,9 +25,13 @@ module completions { --version(-V) # Print version information ] + def "my-app some_cmd sub_cmd config" [] { + [ "Lest quotes, aren't escaped." "Second to trigger display of options" ] + } + # sub-subcommand export extern "my-app some_cmd sub_cmd" [ - --config: string # the other case to test + --config: string@"my-app some_cmd sub_cmd config" # the other case to test --version(-V) # Print version information ] diff --git a/tests/snapshots/value_hint.nu b/tests/snapshots/value_hint.nu new file mode 100644 index 00000000000..9d723f74fd5 --- /dev/null +++ b/tests/snapshots/value_hint.nu @@ -0,0 +1,26 @@ +module completions { + + def "my-app choice" [] { + [ "bash" "fish" "zsh" ] + } + + export extern my-app [ + --choice: string@"my-app choice" + --unknown: string + --other: string + --path(-p): string + --file(-f): string + --dir(-d): string + --exe(-e): string + --cmd-name: string + --cmd(-c): string + command_with_args?: string + --user(-u): string + --host(-H): string + --url: string + --email: string + ] + +} + +use completions * From 889d05df8c0f8809ac4022316c4e84e42288367f Mon Sep 17 00:00:00 2001 From: nibon7 Date: Mon, 31 Oct 2022 22:17:48 +0800 Subject: [PATCH 06/42] perf: reduce memory allocation --- src/lib.rs | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 3ca2d8697a5..c48cf57ab53 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,31 +1,33 @@ //! Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`](https://github.com/clap-rs/clap) based CLIs -use clap::{builder::PossibleValue, Arg, Command}; +use clap::{ + builder::{PossibleValue, StyledStr}, + Arg, Command, +}; use clap_complete::Generator; /// Generate Nushell complete file pub struct Nushell; -enum Argument { +enum Argument<'a> { Short(Vec), - Long(Vec), - ShortAndLong(Vec, Vec), + Long(Vec<&'a str>), + ShortAndLong(Vec, Vec<&'a str>), Positional(bool), } -struct ArgumentLine { - id: String, - name: String, - arg: Argument, +struct ArgumentLine<'a, 'b> { + id: &'a str, + name: &'b str, + arg: Argument<'a>, takes_values: bool, possible_values: Vec, - help: Option, + help: Option<&'a StyledStr>, } -impl ArgumentLine { - fn new(arg: &Arg, bin_name: &str) -> Self { - let id = arg.get_id().to_string(); - let name = bin_name.to_string(); +impl<'a, 'b> ArgumentLine<'a, 'b> { + fn new(arg: &'a Arg, name: &'b str) -> Self { + let id = arg.get_id().as_str(); let takes_values = arg .get_num_args() @@ -34,7 +36,7 @@ impl ArgumentLine { let possible_values = arg.get_possible_values(); - let help = arg.get_help().map(|s| s.to_string()); + let help = arg.get_help(); if arg.is_positional() { let required = arg.is_required_set(); @@ -58,10 +60,7 @@ impl ArgumentLine { Some(longs) => Self { id, name, - arg: Argument::ShortAndLong( - shorts, - longs.iter().map(|s| s.to_string()).collect(), - ), + arg: Argument::ShortAndLong(shorts, longs), takes_values, possible_values, help, @@ -79,7 +78,7 @@ impl ArgumentLine { Some(longs) => Self { id, name, - arg: Argument::Long(longs.iter().map(|s| s.to_string()).collect()), + arg: Argument::Long(longs), takes_values, possible_values, help, @@ -123,7 +122,7 @@ impl ArgumentLine { } } -impl ToString for ArgumentLine { +impl ToString for ArgumentLine<'_, '_> { fn to_string(&self) -> String { let mut s = String::new(); From 78e98e2d7c9836b3d482d0d42587c59c36495ed1 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Mon, 31 Oct 2022 22:56:41 +0800 Subject: [PATCH 07/42] chore: release 0.1.2 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 86a9bfd9271..5c96ddad366 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap_complete_nushell" authors = [ "nibon7 " ] -version = "0.1.1" +version = "0.1.2" edition = "2021" license = "MIT" description = "A generator library used with clap for Nushell completion scripts" From e1e682468b8280a2fa1e46294b3f183014d34e46 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 1 Nov 2022 12:01:26 +0800 Subject: [PATCH 08/42] chore: remove useless reference --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index c48cf57ab53..4da7815da3d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -114,7 +114,7 @@ impl<'a, 'b> ArgumentLine<'a, 'b> { } } - if let Some(help) = &self.help { + if let Some(help) = self.help { s.push_str(format!("\t# {}", help).as_str()); } From 2b6bfeff61adfd2c848d370ec6a9b9dc985acbd8 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 1 Nov 2022 12:03:16 +0800 Subject: [PATCH 09/42] feat: add nu-complete prefix to custom commands --- README.md | 8 ++++---- src/lib.rs | 4 ++-- tests/snapshots/feature_sample.nu | 4 ++-- tests/snapshots/special_commands.nu | 4 ++-- tests/snapshots/sub_subcommands.nu | 8 ++++---- tests/snapshots/value_hint.nu | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 04645228bee..6569685f1ac 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ fn main() { ```nu module completions { - def "myapp choice" [] { + def "nu-complete myapp choice" [] { [ "first" "second" ] } @@ -76,7 +76,7 @@ module completions { --config(-c) # some config file --conf # some config file -C # some config file - choice?: string@"myapp choice" + choice?: string@"nu-complete myapp choice" --version(-V) # Print version information ] @@ -91,13 +91,13 @@ module completions { --version(-V) # Print version information ] - def "myapp some_cmd sub_cmd config" [] { + def "nu-complete myapp some_cmd sub_cmd config" [] { [ "Lest quotes aren't escaped." ] } # sub-subcommand export extern "myapp some_cmd sub_cmd" [ - --config: string@"myapp some_cmd sub_cmd config" # the other case to test + --config: string@"nu-complete myapp some_cmd sub_cmd config" # the other case to test --version(-V) # Print version information ] diff --git a/src/lib.rs b/src/lib.rs index 4da7815da3d..55e3898141e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -93,7 +93,7 @@ impl<'a, 'b> ArgumentLine<'a, 'b> { return None; } - let mut s = format!(r#" def "{} {}" [] {{"#, self.name, self.id); + let mut s = format!(r#" def "nu-complete {} {}" [] {{"#, self.name, self.id); s.push_str("\n ["); for value in &self.possible_values { @@ -110,7 +110,7 @@ impl<'a, 'b> ArgumentLine<'a, 'b> { s.push_str(": string"); if !self.possible_values.is_empty() { - s.push_str(format!(r#"@"{} {}""#, self.name, self.id).as_str()) + s.push_str(format!(r#"@"nu-complete {} {}""#, self.name, self.id).as_str()) } } diff --git a/tests/snapshots/feature_sample.nu b/tests/snapshots/feature_sample.nu index cc9a3982235..57cee01a590 100644 --- a/tests/snapshots/feature_sample.nu +++ b/tests/snapshots/feature_sample.nu @@ -1,6 +1,6 @@ module completions { - def "my-app choice" [] { + def "nu-complete my-app choice" [] { [ "first" "second" ] } @@ -10,7 +10,7 @@ module completions { --config(-c) # some config file --conf # some config file -C # some config file - choice?: string@"my-app choice" + choice?: string@"nu-complete my-app choice" --version(-V) # Print version information ] diff --git a/tests/snapshots/special_commands.nu b/tests/snapshots/special_commands.nu index 83d2b85295b..596aa7a9ee4 100644 --- a/tests/snapshots/special_commands.nu +++ b/tests/snapshots/special_commands.nu @@ -1,6 +1,6 @@ module completions { - def "my-app choice" [] { + def "nu-complete my-app choice" [] { [ "first" "second" ] } @@ -10,7 +10,7 @@ module completions { --config(-c) # some config file --conf # some config file -C # some config file - choice?: string@"my-app choice" + choice?: string@"nu-complete my-app choice" --version(-V) # Print version information ] diff --git a/tests/snapshots/sub_subcommands.nu b/tests/snapshots/sub_subcommands.nu index c30b553e75b..a56800b63ec 100644 --- a/tests/snapshots/sub_subcommands.nu +++ b/tests/snapshots/sub_subcommands.nu @@ -1,6 +1,6 @@ module completions { - def "my-app choice" [] { + def "nu-complete my-app choice" [] { [ "first" "second" ] } @@ -10,7 +10,7 @@ module completions { --config(-c) # some config file --conf # some config file -C # some config file - choice?: string@"my-app choice" + choice?: string@"nu-complete my-app choice" --version(-V) # Print version information ] @@ -25,13 +25,13 @@ module completions { --version(-V) # Print version information ] - def "my-app some_cmd sub_cmd config" [] { + def "nu-complete my-app some_cmd sub_cmd config" [] { [ "Lest quotes, aren't escaped." "Second to trigger display of options" ] } # sub-subcommand export extern "my-app some_cmd sub_cmd" [ - --config: string@"my-app some_cmd sub_cmd config" # the other case to test + --config: string@"nu-complete my-app some_cmd sub_cmd config" # the other case to test --version(-V) # Print version information ] diff --git a/tests/snapshots/value_hint.nu b/tests/snapshots/value_hint.nu index 9d723f74fd5..a4ce5502e51 100644 --- a/tests/snapshots/value_hint.nu +++ b/tests/snapshots/value_hint.nu @@ -1,11 +1,11 @@ module completions { - def "my-app choice" [] { + def "nu-complete my-app choice" [] { [ "bash" "fish" "zsh" ] } export extern my-app [ - --choice: string@"my-app choice" + --choice: string@"nu-complete my-app choice" --unknown: string --other: string --path(-p): string From c9fe396789bc8ddf831f6ae371f206831ac5710b Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 1 Nov 2022 12:03:30 +0800 Subject: [PATCH 10/42] docs: add example to doc comments --- src/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 55e3898141e..de77dbed172 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,19 @@ //! Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`](https://github.com/clap-rs/clap) based CLIs +//! +//! ## Example +//! +//! ``` +//! use clap::Command; +//! use clap_complete::generate; +//! use clap_complete_nushell::Nushell; +//! use std::io; +//! +//! let mut cmd = Command::new("myapp") +//! .subcommand(Command::new("test").subcommand(Command::new("config"))) +//! .subcommand(Command::new("hello")); +//! +//! generate(Nushell, &mut cmd, "myapp", &mut io::stdout()); +//! ``` use clap::{ builder::{PossibleValue, StyledStr}, From 17f9332d3f7f970575b034ce798b3d041c7cd2b0 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 1 Nov 2022 12:04:45 +0800 Subject: [PATCH 11/42] docs: add badges --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6569685f1ac..133857a0f18 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`](https://github.com/clap-rs/clap) based CLIs +[![Crates.io](https://img.shields.io/crates/v/clap_complete_nushell)](https://crates.io/crates/clap_complete_nushell) +[![Crates.io](https://img.shields.io/crates/d/clap_complete_nushell)](https://crates.io/crates/clap_complete_nushell) +[![License](https://img.shields.io/github/license/nibon7/clap_complete_nushell)](LICENSE) +[![docs.rs](https://img.shields.io/docsrs/clap_complete_nushell)](https://docs.rs/clap_complete_nushell) +[![Build Status](https://img.shields.io/github/workflow/status/nibon7/clap_complete_nushell/CI/master)](https://github.com/nibon7/clap_complete_nushell/actions/workflows/ci.yaml?query=branch%3Amaster) + ## Examples ### myapp.rs From 8035519b627a329205a762ba2949a8bdee8ee314 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 1 Nov 2022 12:10:39 +0800 Subject: [PATCH 12/42] chore: release 0.1.3 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5c96ddad366..5a6f049af69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap_complete_nushell" authors = [ "nibon7 " ] -version = "0.1.2" +version = "0.1.3" edition = "2021" license = "MIT" description = "A generator library used with clap for Nushell completion scripts" From fd89b0eb4609a138002081e136affd7fec2a7064 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 1 Nov 2022 13:16:36 +0800 Subject: [PATCH 13/42] refactor: remove enum Argument --- src/lib.rs | 296 +++++++++++++++++++++++++---------------------------- 1 file changed, 140 insertions(+), 156 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index de77dbed172..96b0d07ab0c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,213 +17,202 @@ use clap::{ builder::{PossibleValue, StyledStr}, - Arg, Command, + Arg, Command, Id, }; use clap_complete::Generator; /// Generate Nushell complete file pub struct Nushell; -enum Argument<'a> { - Short(Vec), - Long(Vec<&'a str>), - ShortAndLong(Vec, Vec<&'a str>), - Positional(bool), -} +impl Generator for Nushell { + fn file_name(&self, name: &str) -> String { + format!("{}.nu", name) + } -struct ArgumentLine<'a, 'b> { - id: &'a str, - name: &'b str, - arg: Argument<'a>, - takes_values: bool, - possible_values: Vec, - help: Option<&'a StyledStr>, -} + fn generate(&self, cmd: &Command, buf: &mut dyn std::io::Write) { + let mut completions = String::new(); -impl<'a, 'b> ArgumentLine<'a, 'b> { - fn new(arg: &'a Arg, name: &'b str) -> Self { - let id = arg.get_id().as_str(); + completions.push_str("module completions {\n\n"); - let takes_values = arg - .get_num_args() - .map(|v| v.takes_values()) - .unwrap_or(false); + generate_completion(&mut completions, cmd, false); - let possible_values = arg.get_possible_values(); + for sub in cmd.get_subcommands() { + generate_completion(&mut completions, sub, true); + } - let help = arg.get_help(); + completions.push_str("}\n\n"); + completions.push_str("use completions *\n"); - if arg.is_positional() { - let required = arg.is_required_set(); - let arg = Argument::Positional(required); + buf.write_all(completions.as_bytes()) + .expect("Failed to write to generated file") + } +} - return Self { - id, - name, - arg, - takes_values, - possible_values, - help, - }; - } +struct Argument<'a, 'b> { + arg: &'a Arg, + name: &'b str, +} - let shorts = arg.get_short_and_visible_aliases(); - let longs = arg.get_long_and_visible_aliases(); +impl<'a, 'b> Argument<'a, 'b> { + fn new(arg: &'a Arg, name: &'b str) -> Self { + Self { arg, name } + } - match shorts { - Some(shorts) => match longs { - Some(longs) => Self { - id, - name, - arg: Argument::ShortAndLong(shorts, longs), - takes_values, - possible_values, - help, - }, - None => Self { - id, - name, - arg: Argument::Short(shorts), - takes_values, - possible_values, - help, - }, - }, - None => match longs { - Some(longs) => Self { - id, - name, - arg: Argument::Long(longs), - takes_values, - possible_values, - help, - }, - None => unreachable!("No short or long option found"), - }, - } + fn get_help(&self) -> Option<&StyledStr> { + self.arg.get_help() } - fn generate_value_hints(&self) -> Option { - if self.possible_values.is_empty() { - return None; - } + fn get_id(&self) -> &Id { + self.arg.get_id() + } - let mut s = format!(r#" def "nu-complete {} {}" [] {{"#, self.name, self.id); - s.push_str("\n ["); + fn get_possible_values(&self) -> Vec { + self.arg.get_possible_values() + } - for value in &self.possible_values { - s.push_str(format!(r#" "{}""#, value.get_name()).as_str()); - } + fn get_short_and_visiable_aliases(&self) -> Option> { + self.arg.get_short_and_visible_aliases() + } - s.push_str(" ]\n }\n\n"); + fn get_long_and_visiable_aliases(&self) -> Option> { + self.arg.get_long_and_visible_aliases() + } - Some(s) + fn is_positional(&self) -> bool { + self.arg.is_positional() + } + + fn is_required_set(&self) -> bool { + self.arg.is_required_set() + } + + fn takes_values(&self) -> bool { + self.arg + .get_num_args() + .map(|r| r.takes_values()) + .unwrap_or(false) } fn append_type_and_help(&self, s: &mut String) { - if self.takes_values { + if self.takes_values() { s.push_str(": string"); - if !self.possible_values.is_empty() { - s.push_str(format!(r#"@"nu-complete {} {}""#, self.name, self.id).as_str()) + if !self.get_possible_values().is_empty() { + s.push_str(format!(r#"@"nu-complete {} {}""#, self.name, self.get_id()).as_str()) } } - if let Some(help) = self.help { + if let Some(help) = self.get_help() { s.push_str(format!("\t# {}", help).as_str()); } s.push('\n'); } -} -impl ToString for ArgumentLine<'_, '_> { - fn to_string(&self) -> String { - let mut s = String::new(); - - match &self.arg { - Argument::Short(shorts) => { - for short in shorts { - s.push_str(format!(" -{}", short).as_str()); - self.append_type_and_help(&mut s); - } - } - Argument::Long(longs) => { - for long in longs { - s.push_str(format!(" --{}", long).as_str()); - self.append_type_and_help(&mut s); - } - } - Argument::ShortAndLong(shorts, longs) => { - s.push_str( - format!( - " --{}(-{})", - longs.first().expect("At least one long option expected"), - shorts.first().expect("At lease one short option expected") - ) - .as_str(), - ); - self.append_type_and_help(&mut s); - - // long alias - for long in longs.iter().skip(1) { - s.push_str(format!(" --{}", long).as_str()); - self.append_type_and_help(&mut s); - } - - // short alias - for short in shorts.iter().skip(1) { - s.push_str(format!(" -{}", short).as_str()); - self.append_type_and_help(&mut s); - } - } - Argument::Positional(required) => { - s.push_str(format!(" {}", self.id).as_str()); + fn get_values_completion(&self) -> Option { + let possible_values = self.get_possible_values(); + if possible_values.is_empty() { + return None; + } - if !*required { - s.push('?'); - } + let mut s = format!( + r#" def "nu-complete {} {}" [] {{"#, + self.name, + self.get_id() + ); + s.push_str("\n ["); - self.append_type_and_help(&mut s); - } + for value in &possible_values { + s.push_str(format!(r#" "{}""#, value.get_name()).as_str()); } - s + s.push_str(" ]\n }\n\n"); + + Some(s) } } -impl Generator for Nushell { - fn file_name(&self, name: &str) -> String { - format!("{}.nu", name) - } +impl ToString for Argument<'_, '_> { + fn to_string(&self) -> String { + let mut s = String::new(); - fn generate(&self, cmd: &Command, buf: &mut dyn std::io::Write) { - let mut completions = String::new(); + if self.is_positional() { + s.push_str(format!(" {}", self.get_id()).as_str()); - completions.push_str("module completions {\n\n"); + if !self.is_required_set() { + s.push('?'); + } - generate_completion(&mut completions, cmd, false); + self.append_type_and_help(&mut s); - for sub in cmd.get_subcommands() { - generate_completion(&mut completions, sub, true); + return s; } - completions.push_str("}\n\n"); - completions.push_str("use completions *\n"); + let shorts = self.get_short_and_visiable_aliases(); + let longs = self.get_long_and_visiable_aliases(); - buf.write_all(completions.as_bytes()) - .expect("Failed to write to generated file") + match shorts { + Some(shorts) => match longs { + Some(longs) => { + // short options and long options + s.push_str( + format!( + " --{}(-{})", + longs.first().expect("At least one long option expected"), + shorts.first().expect("At lease one short option expected") + ) + .as_str(), + ); + self.append_type_and_help(&mut s); + + // long alias + for long in longs.iter().skip(1) { + s.push_str(format!(" --{}", long).as_str()); + self.append_type_and_help(&mut s); + } + + // short alias + for short in shorts.iter().skip(1) { + s.push_str(format!(" -{}", short).as_str()); + self.append_type_and_help(&mut s); + } + } + None => { + // short options only + for short in shorts { + s.push_str(format!(" -{}", short).as_str()); + self.append_type_and_help(&mut s); + } + } + }, + None => match longs { + Some(longs) => { + // long options only + for long in longs { + s.push_str(format!(" --{}", long).as_str()); + self.append_type_and_help(&mut s); + } + } + None => unreachable!("No short or long optioin found"), + }, + } + + s } } fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: bool) { let bin_name = cmd.get_bin_name().expect("Failed to get bin name"); - for hint in cmd + for v in cmd .get_arguments() - .filter_map(|arg| ArgumentLine::new(arg, bin_name).generate_value_hints()) + .filter_map(|arg| Argument::new(arg, bin_name).get_values_completion()) { - completions.push_str(&hint); + completions.push_str(&v); + } + + if let Some(about) = cmd.get_about() { + completions.push_str(format!(" # {}\n", about).as_str()); } let name = if is_subcommand { @@ -232,21 +221,16 @@ fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: b bin_name.into() }; - if let Some(about) = cmd.get_about() { - completions.push_str(format!(" # {}\n", about).as_str()); - } - completions.push_str(format!(" export extern {} [\n", name).as_str()); let s: String = cmd .get_arguments() - .map(|arg| ArgumentLine::new(arg, bin_name).to_string()) + .map(|arg| Argument::new(arg, bin_name).to_string()) .collect(); completions.push_str(&s); completions.push_str(" ]\n\n"); - // For sub-subcommands if is_subcommand { for sub in cmd.get_subcommands() { generate_completion(completions, sub, true); From 90555c39c578e1ea05c26bf7393bacc20998eba9 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 1 Nov 2022 13:18:05 +0800 Subject: [PATCH 14/42] ci: update CI to check nushell scripts --- .github/workflows/ci.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d1f91843c44..fd1b164ea7f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,3 +36,18 @@ jobs: - name: Install Rust run: rustup update stable && rustup default stable && rustup component add rustfmt - run: cargo fmt -- --check + + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: hustcer/setup-nu@v2.1 + with: + check-latest: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: | + echo "Nushell version: $(nu -c '(version).version')" + for i in tests/snapshots/*.nu; do nu -c "print -n $'(ansi green)Checking $i ...'; ansi reset; source $i"; done + shell: bash From c19fc425d0c42ea72161b5e36c5e682a4129af83 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 1 Nov 2022 23:33:18 +0800 Subject: [PATCH 15/42] chore: release 0.1.4 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5a6f049af69..40b55da1118 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap_complete_nushell" authors = [ "nibon7 " ] -version = "0.1.3" +version = "0.1.4" edition = "2021" license = "MIT" description = "A generator library used with clap for Nushell completion scripts" From c6fe49aba51efa0ad14b1b9adf5d8c900a89f540 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Wed, 2 Nov 2022 11:58:54 +0800 Subject: [PATCH 16/42] feat: add rest argument completion --- src/lib.rs | 15 ++++++++++----- tests/snapshots/special_commands.nu | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 96b0d07ab0c..22cf7997eaa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,7 +17,7 @@ use clap::{ builder::{PossibleValue, StyledStr}, - Arg, Command, Id, + Arg, ArgAction, Command, Id, }; use clap_complete::Generator; @@ -137,10 +137,15 @@ impl ToString for Argument<'_, '_> { let mut s = String::new(); if self.is_positional() { - s.push_str(format!(" {}", self.get_id()).as_str()); - - if !self.is_required_set() { - s.push('?'); + // rest arguments + if matches!(self.arg.get_action(), ArgAction::Append) { + s.push_str(format!(" ...{}", self.get_id()).as_str()); + } else { + s.push_str(format!(" {}", self.get_id()).as_str()); + + if !self.is_required_set() { + s.push('?'); + } } self.append_type_and_help(&mut s); diff --git a/tests/snapshots/special_commands.nu b/tests/snapshots/special_commands.nu index 596aa7a9ee4..336aceba258 100644 --- a/tests/snapshots/special_commands.nu +++ b/tests/snapshots/special_commands.nu @@ -23,7 +23,7 @@ module completions { # tests other things export extern "my-app some_cmd" [ --config: string # the other case to test - path?: string + ...path: string --version(-V) # Print version information ] From 50aefdb9b34db4c70155a5ac8c6bef6ca8a73f10 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Wed, 2 Nov 2022 11:59:33 +0800 Subject: [PATCH 17/42] fix: escape quotes when string has whitespace --- README.md | 11 ++++------- src/lib.rs | 7 ++++++- tests/snapshots/sub_subcommands.nu | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 133857a0f18..78bf337eec0 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`] ### myapp.rs ```rust -use clap::{Arg, ArgAction, Command}; +use clap::{builder::PossibleValue, Arg, ArgAction, Command, ValueHint}; use clap_complete::generate; use clap_complete_nushell::Nushell; use std::io; @@ -25,7 +25,7 @@ fn main() { .about("Tests completions") .arg( Arg::new("file") - .value_hint(clap::ValueHint::FilePath) + .value_hint(ValueHint::FilePath) .help("some input file"), ) .arg( @@ -54,9 +54,7 @@ fn main() { Arg::new("config") .long("config") .action(ArgAction::Set) - .value_parser([clap::builder::PossibleValue::new( - "Lest quotes aren't escaped.", - )]) + .value_parser([PossibleValue::new("Lest quotes aren't escaped.")]) .help("the other case to test"), ), ), @@ -66,7 +64,6 @@ fn main() { } ``` - ### myapp.nu ```nu @@ -98,7 +95,7 @@ module completions { ] def "nu-complete myapp some_cmd sub_cmd config" [] { - [ "Lest quotes aren't escaped." ] + [ "\"Lest quotes aren't escaped.\"" ] } # sub-subcommand diff --git a/src/lib.rs b/src/lib.rs index 22cf7997eaa..780a5979528 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -123,7 +123,12 @@ impl<'a, 'b> Argument<'a, 'b> { s.push_str("\n ["); for value in &possible_values { - s.push_str(format!(r#" "{}""#, value.get_name()).as_str()); + let name = value.get_name(); + if name.contains(|c: char| c.is_whitespace()) { + s.push_str(format!(r#" "\"{}\"""#, name).as_str()); + } else { + s.push_str(format!(r#" "{}""#, name).as_str()); + } } s.push_str(" ]\n }\n\n"); diff --git a/tests/snapshots/sub_subcommands.nu b/tests/snapshots/sub_subcommands.nu index a56800b63ec..abcfac81650 100644 --- a/tests/snapshots/sub_subcommands.nu +++ b/tests/snapshots/sub_subcommands.nu @@ -26,7 +26,7 @@ module completions { ] def "nu-complete my-app some_cmd sub_cmd config" [] { - [ "Lest quotes, aren't escaped." "Second to trigger display of options" ] + [ "\"Lest quotes, aren't escaped.\"" "\"Second to trigger display of options\"" ] } # sub-subcommand From da3bcd82e532b30e390cb5ba4e87890b99ec7b00 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Wed, 2 Nov 2022 12:00:19 +0800 Subject: [PATCH 18/42] test: add quoting test --- tests/common.rs | 129 ++++++++++++++++++++++++------------- tests/nushell.rs | 12 ++++ tests/snapshots/quoting.nu | 39 +++++++++++ 3 files changed, 136 insertions(+), 44 deletions(-) create mode 100644 tests/snapshots/quoting.nu diff --git a/tests/common.rs b/tests/common.rs index ddaa1ad8b8c..e96323e6343 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -51,23 +51,72 @@ pub fn feature_sample_command(name: &'static str) -> Command { ) } -pub fn special_commands_command(name: &'static str) -> clap::Command { +pub fn special_commands_command(name: &'static str) -> Command { feature_sample_command(name) .subcommand( - clap::Command::new("some_cmd") + Command::new("some_cmd") .about("tests other things") .arg( - clap::Arg::new("config") + Arg::new("config") .long("config") .hide(true) - .action(clap::ArgAction::Set) + .action(ArgAction::Set) .require_equals(true) .help("the other case to test"), ) - .arg(clap::Arg::new("path").num_args(1..)), + .arg(Arg::new("path").num_args(1..)), + ) + .subcommand(Command::new("some-cmd-with-hyphens").alias("hyphen")) + .subcommand(Command::new("some-hidden-cmd").hide(true)) +} + +pub fn quoting_command(name: &'static str) -> Command { + Command::new(name) + .version("3.0") + .arg( + Arg::new("single-quotes") + .long("single-quotes") + .action(ArgAction::SetTrue) + .help("Can be 'always', 'auto', or 'never'"), + ) + .arg( + Arg::new("double-quotes") + .long("double-quotes") + .action(ArgAction::SetTrue) + .help("Can be \"always\", \"auto\", or \"never\""), + ) + .arg( + Arg::new("backticks") + .long("backticks") + .action(ArgAction::SetTrue) + .help("For more information see `echo test`"), ) - .subcommand(clap::Command::new("some-cmd-with-hyphens").alias("hyphen")) - .subcommand(clap::Command::new("some-hidden-cmd").hide(true)) + .arg( + Arg::new("backslash") + .long("backslash") + .action(ArgAction::SetTrue) + .help("Avoid '\\n'"), + ) + .arg( + Arg::new("brackets") + .long("brackets") + .action(ArgAction::SetTrue) + .help("List packages [filter]"), + ) + .arg( + Arg::new("expansions") + .long("expansions") + .action(ArgAction::SetTrue) + .help("Execute the shell command with $SHELL"), + ) + .subcommands([ + Command::new("cmd-single-quotes").about("Can be 'always', 'auto', or 'never'"), + Command::new("cmd-double-quotes").about("Can be \"always\", \"auto\", or \"never\""), + Command::new("cmd-backticks").about("For more information see `echo test`"), + Command::new("cmd-backslash").about("Avoid '\\n'"), + Command::new("cmd-brackets").about("List packages [filter]"), + Command::new("cmd-expansions").about("Execute the shell command with $SHELL"), + ]) } pub fn aliases_command(name: &'static str) -> Command { @@ -116,87 +165,79 @@ pub fn sub_subcommands_command(name: &'static str) -> Command { ) } -pub fn value_hint_command(name: &'static str) -> clap::Command { - clap::Command::new(name) +pub fn value_hint_command(name: &'static str) -> Command { + Command::new(name) .arg( - clap::Arg::new("choice") + Arg::new("choice") .long("choice") - .action(clap::ArgAction::Set) + .action(ArgAction::Set) .value_parser(["bash", "fish", "zsh"]), ) .arg( - clap::Arg::new("unknown") + Arg::new("unknown") .long("unknown") - .value_hint(clap::ValueHint::Unknown), - ) - .arg( - clap::Arg::new("other") - .long("other") - .value_hint(clap::ValueHint::Other), + .value_hint(ValueHint::Unknown), ) + .arg(Arg::new("other").long("other").value_hint(ValueHint::Other)) .arg( - clap::Arg::new("path") + Arg::new("path") .long("path") .short('p') - .value_hint(clap::ValueHint::AnyPath), + .value_hint(ValueHint::AnyPath), ) .arg( - clap::Arg::new("file") + Arg::new("file") .long("file") .short('f') - .value_hint(clap::ValueHint::FilePath), + .value_hint(ValueHint::FilePath), ) .arg( - clap::Arg::new("dir") + Arg::new("dir") .long("dir") .short('d') - .value_hint(clap::ValueHint::DirPath), + .value_hint(ValueHint::DirPath), ) .arg( - clap::Arg::new("exe") + Arg::new("exe") .long("exe") .short('e') - .value_hint(clap::ValueHint::ExecutablePath), + .value_hint(ValueHint::ExecutablePath), ) .arg( - clap::Arg::new("cmd_name") + Arg::new("cmd_name") .long("cmd-name") - .value_hint(clap::ValueHint::CommandName), + .value_hint(ValueHint::CommandName), ) .arg( - clap::Arg::new("cmd") + Arg::new("cmd") .long("cmd") .short('c') - .value_hint(clap::ValueHint::CommandString), + .value_hint(ValueHint::CommandString), ) .arg( - clap::Arg::new("command_with_args") - .action(clap::ArgAction::Set) + Arg::new("command_with_args") + .action(ArgAction::Set) .num_args(1..) .trailing_var_arg(true) - .value_hint(clap::ValueHint::CommandWithArguments), + .value_hint(ValueHint::CommandWithArguments), ) .arg( - clap::Arg::new("user") + Arg::new("user") .short('u') .long("user") - .value_hint(clap::ValueHint::Username), + .value_hint(ValueHint::Username), ) .arg( - clap::Arg::new("host") + Arg::new("host") .short('H') .long("host") - .value_hint(clap::ValueHint::Hostname), - ) - .arg( - clap::Arg::new("url") - .long("url") - .value_hint(clap::ValueHint::Url), + .value_hint(ValueHint::Hostname), ) + .arg(Arg::new("url").long("url").value_hint(ValueHint::Url)) .arg( - clap::Arg::new("email") + Arg::new("email") .long("email") - .value_hint(clap::ValueHint::EmailAddress), + .value_hint(ValueHint::EmailAddress), ) } diff --git a/tests/nushell.rs b/tests/nushell.rs index acefc88563c..1987fd70dd5 100644 --- a/tests/nushell.rs +++ b/tests/nushell.rs @@ -36,6 +36,18 @@ fn special_commands() { ); } +#[test] +fn quoting() { + let name = "my-app"; + let cmd = common::quoting_command(name); + common::assert_matches_path( + "tests/snapshots/quoting.nu", + clap_complete_nushell::Nushell, + cmd, + name, + ); +} + #[test] fn aliases() { let name = "my-app"; diff --git a/tests/snapshots/quoting.nu b/tests/snapshots/quoting.nu new file mode 100644 index 00000000000..014443ffa76 --- /dev/null +++ b/tests/snapshots/quoting.nu @@ -0,0 +1,39 @@ +module completions { + + export extern my-app [ + --single-quotes # Can be 'always', 'auto', or 'never' + --double-quotes # Can be "always", "auto", or "never" + --backticks # For more information see `echo test` + --backslash # Avoid '\n' + --brackets # List packages [filter] + --expansions # Execute the shell command with $SHELL + --version(-V) # Print version information + ] + + # Can be 'always', 'auto', or 'never' + export extern "my-app cmd-single-quotes" [ + ] + + # Can be "always", "auto", or "never" + export extern "my-app cmd-double-quotes" [ + ] + + # For more information see `echo test` + export extern "my-app cmd-backticks" [ + ] + + # Avoid '\n' + export extern "my-app cmd-backslash" [ + ] + + # List packages [filter] + export extern "my-app cmd-brackets" [ + ] + + # Execute the shell command with $SHELL + export extern "my-app cmd-expansions" [ + ] + +} + +use completions * From 3c8cbfa11164b0257bc17ad41c65b6762fe3d443 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Wed, 2 Nov 2022 12:00:48 +0800 Subject: [PATCH 19/42] chore: release 0.1.5 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 40b55da1118..d50db5168e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap_complete_nushell" authors = [ "nibon7 " ] -version = "0.1.4" +version = "0.1.5" edition = "2021" license = "MIT" description = "A generator library used with clap for Nushell completion scripts" From a0b1e2118b39806eb5a52d9e1524479f687999fa Mon Sep 17 00:00:00 2001 From: nibon7 Date: Wed, 2 Nov 2022 18:31:11 +0800 Subject: [PATCH 20/42] chore: remove wrapped functions --- src/lib.rs | 77 ++++++++++++++++-------------------------------------- 1 file changed, 23 insertions(+), 54 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 780a5979528..13797bb97f9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,10 +15,7 @@ //! generate(Nushell, &mut cmd, "myapp", &mut io::stdout()); //! ``` -use clap::{ - builder::{PossibleValue, StyledStr}, - Arg, ArgAction, Command, Id, -}; +use clap::{Arg, ArgAction, Command}; use clap_complete::Generator; /// Generate Nushell complete file @@ -58,34 +55,6 @@ impl<'a, 'b> Argument<'a, 'b> { Self { arg, name } } - fn get_help(&self) -> Option<&StyledStr> { - self.arg.get_help() - } - - fn get_id(&self) -> &Id { - self.arg.get_id() - } - - fn get_possible_values(&self) -> Vec { - self.arg.get_possible_values() - } - - fn get_short_and_visiable_aliases(&self) -> Option> { - self.arg.get_short_and_visible_aliases() - } - - fn get_long_and_visiable_aliases(&self) -> Option> { - self.arg.get_long_and_visible_aliases() - } - - fn is_positional(&self) -> bool { - self.arg.is_positional() - } - - fn is_required_set(&self) -> bool { - self.arg.is_required_set() - } - fn takes_values(&self) -> bool { self.arg .get_num_args() @@ -97,12 +66,14 @@ impl<'a, 'b> Argument<'a, 'b> { if self.takes_values() { s.push_str(": string"); - if !self.get_possible_values().is_empty() { - s.push_str(format!(r#"@"nu-complete {} {}""#, self.name, self.get_id()).as_str()) + if !self.arg.get_possible_values().is_empty() { + s.push_str( + format!(r#"@"nu-complete {} {}""#, self.name, self.arg.get_id()).as_str(), + ) } } - if let Some(help) = self.get_help() { + if let Some(help) = self.arg.get_help() { s.push_str(format!("\t# {}", help).as_str()); } @@ -110,7 +81,7 @@ impl<'a, 'b> Argument<'a, 'b> { } fn get_values_completion(&self) -> Option { - let possible_values = self.get_possible_values(); + let possible_values = self.arg.get_possible_values(); if possible_values.is_empty() { return None; } @@ -118,7 +89,7 @@ impl<'a, 'b> Argument<'a, 'b> { let mut s = format!( r#" def "nu-complete {} {}" [] {{"#, self.name, - self.get_id() + self.arg.get_id() ); s.push_str("\n ["); @@ -141,14 +112,14 @@ impl ToString for Argument<'_, '_> { fn to_string(&self) -> String { let mut s = String::new(); - if self.is_positional() { + if self.arg.is_positional() { // rest arguments if matches!(self.arg.get_action(), ArgAction::Append) { - s.push_str(format!(" ...{}", self.get_id()).as_str()); + s.push_str(format!(" ...{}", self.arg.get_id()).as_str()); } else { - s.push_str(format!(" {}", self.get_id()).as_str()); + s.push_str(format!(" {}", self.arg.get_id()).as_str()); - if !self.is_required_set() { + if !self.arg.is_required_set() { s.push('?'); } } @@ -158,8 +129,8 @@ impl ToString for Argument<'_, '_> { return s; } - let shorts = self.get_short_and_visiable_aliases(); - let longs = self.get_long_and_visiable_aliases(); + let shorts = self.arg.get_short_and_visible_aliases(); + let longs = self.arg.get_long_and_visible_aliases(); match shorts { Some(shorts) => match longs { @@ -212,30 +183,28 @@ impl ToString for Argument<'_, '_> { } fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: bool) { - let bin_name = cmd.get_bin_name().expect("Failed to get bin name"); + let name = cmd.get_bin_name().expect("Failed to get bin name"); - for v in cmd + for value in cmd .get_arguments() - .filter_map(|arg| Argument::new(arg, bin_name).get_values_completion()) + .filter_map(|arg| Argument::new(arg, name).get_values_completion()) { - completions.push_str(&v); + completions.push_str(&value); } if let Some(about) = cmd.get_about() { completions.push_str(format!(" # {}\n", about).as_str()); } - let name = if is_subcommand { - format!(r#""{}""#, bin_name) + if is_subcommand { + completions.push_str(format!(" export extern \"{}\" [\n", name).as_str()); } else { - bin_name.into() - }; - - completions.push_str(format!(" export extern {} [\n", name).as_str()); + completions.push_str(format!(" export extern {} [\n", name).as_str()); + } let s: String = cmd .get_arguments() - .map(|arg| Argument::new(arg, bin_name).to_string()) + .map(|arg| Argument::new(arg, name).to_string()) .collect(); completions.push_str(&s); From b35619171c9a0cb261fabb46544d860cb2e64737 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Wed, 2 Nov 2022 18:40:20 +0800 Subject: [PATCH 21/42] feat: align help message --- README.md | 20 ++++++++++---------- src/lib.rs | 7 ++++++- tests/snapshots/aliases.nu | 14 +++++++------- tests/snapshots/feature_sample.nu | 14 +++++++------- tests/snapshots/quoting.nu | 14 +++++++------- tests/snapshots/special_commands.nu | 22 +++++++++++----------- tests/snapshots/sub_subcommands.nu | 20 ++++++++++---------- 7 files changed, 58 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 78bf337eec0..abb6b12317d 100644 --- a/README.md +++ b/README.md @@ -75,23 +75,23 @@ module completions { # Tests completions export extern myapp [ - file?: string # some input file - --config(-c) # some config file - --conf # some config file - -C # some config file + file?: string # some input file + --config(-c) # some config file + --conf # some config file + -C # some config file choice?: string@"nu-complete myapp choice" - --version(-V) # Print version information + --version(-V) # Print version information ] # tests things export extern "myapp test" [ - --case: string # the case to test - --version(-V) # Print version information + --case: string # the case to test + --version(-V) # Print version information ] # top level subcommand export extern "myapp some_cmd" [ - --version(-V) # Print version information + --version(-V) # Print version information ] def "nu-complete myapp some_cmd sub_cmd config" [] { @@ -100,8 +100,8 @@ module completions { # sub-subcommand export extern "myapp some_cmd sub_cmd" [ - --config: string@"nu-complete myapp some_cmd sub_cmd config" # the other case to test - --version(-V) # Print version information + --config: string@"nu-complete myapp some_cmd sub_cmd config" # the other case to test + --version(-V) # Print version information ] } diff --git a/src/lib.rs b/src/lib.rs index 13797bb97f9..515a2de3348 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -74,7 +74,12 @@ impl<'a, 'b> Argument<'a, 'b> { } if let Some(help) = self.arg.get_help() { - s.push_str(format!("\t# {}", help).as_str()); + let max: usize = 30; + let mut width = 0; + if let Some(line) = s.lines().last() { + width = max.saturating_sub(line.len()); + } + s.push_str(format!("{:>width$}# {}", ' ', help,).as_str()); } s.push('\n'); diff --git a/tests/snapshots/aliases.nu b/tests/snapshots/aliases.nu index 1a7d9314363..39bf07b9b71 100644 --- a/tests/snapshots/aliases.nu +++ b/tests/snapshots/aliases.nu @@ -2,14 +2,14 @@ module completions { # testing nushell completions export extern my-app [ - --flag(-f) # cmd flag - --flg # cmd flag - -F # cmd flag - --option(-o): string # cmd option - --opt: string # cmd option - -O: string # cmd option + --flag(-f) # cmd flag + --flg # cmd flag + -F # cmd flag + --option(-o): string # cmd option + --opt: string # cmd option + -O: string # cmd option positional?: string - --version(-V) # Print version information + --version(-V) # Print version information ] } diff --git a/tests/snapshots/feature_sample.nu b/tests/snapshots/feature_sample.nu index 57cee01a590..8796745ff1f 100644 --- a/tests/snapshots/feature_sample.nu +++ b/tests/snapshots/feature_sample.nu @@ -6,18 +6,18 @@ module completions { # Tests completions export extern my-app [ - file?: string # some input file - --config(-c) # some config file - --conf # some config file - -C # some config file + file?: string # some input file + --config(-c) # some config file + --conf # some config file + -C # some config file choice?: string@"nu-complete my-app choice" - --version(-V) # Print version information + --version(-V) # Print version information ] # tests things export extern "my-app test" [ - --case: string # the case to test - --version(-V) # Print version information + --case: string # the case to test + --version(-V) # Print version information ] } diff --git a/tests/snapshots/quoting.nu b/tests/snapshots/quoting.nu index 014443ffa76..3d4f1408677 100644 --- a/tests/snapshots/quoting.nu +++ b/tests/snapshots/quoting.nu @@ -1,13 +1,13 @@ module completions { export extern my-app [ - --single-quotes # Can be 'always', 'auto', or 'never' - --double-quotes # Can be "always", "auto", or "never" - --backticks # For more information see `echo test` - --backslash # Avoid '\n' - --brackets # List packages [filter] - --expansions # Execute the shell command with $SHELL - --version(-V) # Print version information + --single-quotes # Can be 'always', 'auto', or 'never' + --double-quotes # Can be "always", "auto", or "never" + --backticks # For more information see `echo test` + --backslash # Avoid '\n' + --brackets # List packages [filter] + --expansions # Execute the shell command with $SHELL + --version(-V) # Print version information ] # Can be 'always', 'auto', or 'never' diff --git a/tests/snapshots/special_commands.nu b/tests/snapshots/special_commands.nu index 336aceba258..6df906e93c0 100644 --- a/tests/snapshots/special_commands.nu +++ b/tests/snapshots/special_commands.nu @@ -6,33 +6,33 @@ module completions { # Tests completions export extern my-app [ - file?: string # some input file - --config(-c) # some config file - --conf # some config file - -C # some config file + file?: string # some input file + --config(-c) # some config file + --conf # some config file + -C # some config file choice?: string@"nu-complete my-app choice" - --version(-V) # Print version information + --version(-V) # Print version information ] # tests things export extern "my-app test" [ - --case: string # the case to test - --version(-V) # Print version information + --case: string # the case to test + --version(-V) # Print version information ] # tests other things export extern "my-app some_cmd" [ - --config: string # the other case to test + --config: string # the other case to test ...path: string - --version(-V) # Print version information + --version(-V) # Print version information ] export extern "my-app some-cmd-with-hyphens" [ - --version(-V) # Print version information + --version(-V) # Print version information ] export extern "my-app some-hidden-cmd" [ - --version(-V) # Print version information + --version(-V) # Print version information ] } diff --git a/tests/snapshots/sub_subcommands.nu b/tests/snapshots/sub_subcommands.nu index abcfac81650..d0e7f8fe0fc 100644 --- a/tests/snapshots/sub_subcommands.nu +++ b/tests/snapshots/sub_subcommands.nu @@ -6,23 +6,23 @@ module completions { # Tests completions export extern my-app [ - file?: string # some input file - --config(-c) # some config file - --conf # some config file - -C # some config file + file?: string # some input file + --config(-c) # some config file + --conf # some config file + -C # some config file choice?: string@"nu-complete my-app choice" - --version(-V) # Print version information + --version(-V) # Print version information ] # tests things export extern "my-app test" [ - --case: string # the case to test - --version(-V) # Print version information + --case: string # the case to test + --version(-V) # Print version information ] # top level subcommand export extern "my-app some_cmd" [ - --version(-V) # Print version information + --version(-V) # Print version information ] def "nu-complete my-app some_cmd sub_cmd config" [] { @@ -31,8 +31,8 @@ module completions { # sub-subcommand export extern "my-app some_cmd sub_cmd" [ - --config: string@"nu-complete my-app some_cmd sub_cmd config" # the other case to test - --version(-V) # Print version information + --config: string@"nu-complete my-app some_cmd sub_cmd config" # the other case to test + --version(-V) # Print version information ] } From 26fe5dbe96fed2ef16ef4d36222b031b5a9fc86d Mon Sep 17 00:00:00 2001 From: nibon7 Date: Thu, 3 Nov 2022 08:44:54 +0800 Subject: [PATCH 22/42] chore: release 0.1.6 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d50db5168e1..e6e1855cf03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap_complete_nushell" authors = [ "nibon7 " ] -version = "0.1.5" +version = "0.1.6" edition = "2021" license = "MIT" description = "A generator library used with clap for Nushell completion scripts" From a895ef3d4cb5008497b8fc87f055412e000f1569 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Thu, 3 Nov 2022 17:50:10 +0800 Subject: [PATCH 23/42] perf: reduce memory allocation --- src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 515a2de3348..83b3c960fc1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -207,12 +207,13 @@ fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: b completions.push_str(format!(" export extern {} [\n", name).as_str()); } - let s: String = cmd + for s in cmd .get_arguments() .map(|arg| Argument::new(arg, name).to_string()) - .collect(); + { + completions.push_str(&s); + } - completions.push_str(&s); completions.push_str(" ]\n\n"); if is_subcommand { From d6a37c120739849e69f0b665de4807573e456a56 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Thu, 3 Nov 2022 20:32:02 +0800 Subject: [PATCH 24/42] perf: reduce memory allocation --- src/lib.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 83b3c960fc1..644efca6898 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ //! generate(Nushell, &mut cmd, "myapp", &mut io::stdout()); //! ``` -use clap::{Arg, ArgAction, Command}; +use clap::{builder::PossibleValue, Arg, ArgAction, Command}; use clap_complete::Generator; /// Generate Nushell complete file @@ -48,11 +48,18 @@ impl Generator for Nushell { struct Argument<'a, 'b> { arg: &'a Arg, name: &'b str, + possible_values: Vec, } impl<'a, 'b> Argument<'a, 'b> { fn new(arg: &'a Arg, name: &'b str) -> Self { - Self { arg, name } + let possible_values = arg.get_possible_values(); + + Self { + arg, + name, + possible_values, + } } fn takes_values(&self) -> bool { @@ -66,7 +73,7 @@ impl<'a, 'b> Argument<'a, 'b> { if self.takes_values() { s.push_str(": string"); - if !self.arg.get_possible_values().is_empty() { + if !self.possible_values.is_empty() { s.push_str( format!(r#"@"nu-complete {} {}""#, self.name, self.arg.get_id()).as_str(), ) @@ -86,8 +93,7 @@ impl<'a, 'b> Argument<'a, 'b> { } fn get_values_completion(&self) -> Option { - let possible_values = self.arg.get_possible_values(); - if possible_values.is_empty() { + if self.possible_values.is_empty() { return None; } @@ -98,7 +104,7 @@ impl<'a, 'b> Argument<'a, 'b> { ); s.push_str("\n ["); - for value in &possible_values { + for value in &self.possible_values { let name = value.get_name(); if name.contains(|c: char| c.is_whitespace()) { s.push_str(format!(r#" "\"{}\"""#, name).as_str()); From ede83f161b478e8c286685957d5d29d3b0a4ad80 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Thu, 3 Nov 2022 20:38:00 +0800 Subject: [PATCH 25/42] chore: release 0.1.7 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index e6e1855cf03..1f2b83bba68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap_complete_nushell" authors = [ "nibon7 " ] -version = "0.1.6" +version = "0.1.7" edition = "2021" license = "MIT" description = "A generator library used with clap for Nushell completion scripts" From d5bfa0cb67b02a7c9e132ebb4508d2c925f27d4e Mon Sep 17 00:00:00 2001 From: nibon7 Date: Fri, 4 Nov 2022 19:41:23 +0800 Subject: [PATCH 26/42] chore: add sub_subcommands example and nu script to generate readme dynamically --- Cargo.toml | 5 +++- examples/sub_subcommands.rs | 49 +++++++++++++++++++++++++++++++++++ scripts/gen_readme.nu | 51 +++++++++++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 examples/sub_subcommands.rs create mode 100755 scripts/gen_readme.nu diff --git a/Cargo.toml b/Cargo.toml index 1f2b83bba68..67b94de6498 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,10 @@ keywords = [ "completion", "nushell" ] -exclude = [ "tests/*" ] +exclude = [ + "tests/*", + "scripts/*" +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/examples/sub_subcommands.rs b/examples/sub_subcommands.rs new file mode 100644 index 00000000000..e09b7a46461 --- /dev/null +++ b/examples/sub_subcommands.rs @@ -0,0 +1,49 @@ +use clap::{builder::PossibleValue, Arg, ArgAction, Command, ValueHint}; +use clap_complete::generate; +use clap_complete_nushell::Nushell; +use std::io; + +fn main() { + let mut cmd = Command::new("myapp") + .version("3.0") + .propagate_version(true) + .about("Tests completions") + .arg( + Arg::new("file") + .value_hint(ValueHint::FilePath) + .help("some input file"), + ) + .arg( + Arg::new("config") + .action(ArgAction::Count) + .help("some config file") + .short('c') + .visible_short_alias('C') + .long("config") + .visible_alias("conf"), + ) + .arg(Arg::new("choice").value_parser(["first", "second"])) + .subcommand( + Command::new("test").about("tests things").arg( + Arg::new("case") + .long("case") + .action(ArgAction::Set) + .help("the case to test"), + ), + ) + .subcommand( + Command::new("some_cmd") + .about("top level subcommand") + .subcommand( + Command::new("sub_cmd").about("sub-subcommand").arg( + Arg::new("config") + .long("config") + .action(ArgAction::Set) + .value_parser([PossibleValue::new("Lest quotes aren't escaped.")]) + .help("the other case to test"), + ), + ), + ); + + generate(Nushell, &mut cmd, "myapp", &mut io::stdout()); +} diff --git a/scripts/gen_readme.nu b/scripts/gen_readme.nu new file mode 100755 index 00000000000..87c97d5295f --- /dev/null +++ b/scripts/gen_readme.nu @@ -0,0 +1,51 @@ +#!/usr/bin/env nu + +let example_file = "examples/sub_subcommands.rs" + +def generate_url [baseurl: string, ...path: string] { + [$baseurl] + |append $path + |str join '/' +} + +def generate_preamble [user: string, repo: string] { + let baseurl = "https://img.shields.io" + let crates = "https://crates.io" + let docs = "https://docs.rs" + let github = "https://github.com" + + $"# ($repo) + +Generates [Nushell]\((generate_url $github nushell/nushell)\) completions for [`clap`]\((generate_url $github clap-rs/clap)\) based CLIs + +[![Crates.io]\((generate_url $baseurl crates/v $repo)\)]\((generate_url $crates crates $repo)\) +[![Crates.io]\((generate_url $baseurl crates/d $repo)\)]\((generate_url $crates crates $repo)\) +[![License]\((generate_url $baseurl github/license $user)/(generate_url $repo)\)]\(LICENSE\) +[![docs.rs]\((generate_url $baseurl docsrs $repo)\)]\((generate_url $docs $repo)\) +[![Build Status]\((generate_url $baseurl github/workflow/status $user $repo CI/master)\)]\((generate_url $github $user $repo actions/workflows/ci.yaml?query=branch%3Amaster)\)\n" +} + +def code_to_md [title: string, lang: string, code: string] { + $"### ($title)\n\n```($lang)\n($code)```\n" +} + +def generate_md [file: path] { + let package = (open Cargo.toml | get package) + let user = ($package.authors | first | str replace ' <.*@.*>$' '') + let repo = $package.name + let stem = ($file | path parse | get stem) + let rust_code = (open -r $file) + let nu_code = (cargo run --quiet --example $stem) + let rust_example = (code_to_md myapp.rs rust $rust_code) + let nu_example = (code_to_md myapp.nu nu $nu_code) + + |generate_preamble $user $repo + |[$in] + |append "## Examples\n" + |append $rust_example + |append $nu_example + |str join "\n" + |save -r README.md +} + +generate_md $example_file From 82e5e34438f93dacf2ab0103f37383e7d264808e Mon Sep 17 00:00:00 2001 From: nibon7 Date: Sat, 5 Nov 2022 11:32:44 +0800 Subject: [PATCH 27/42] refactor: remove struct Argument --- src/lib.rs | 230 +++++++++++++++++++++++------------------------------ 1 file changed, 99 insertions(+), 131 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 644efca6898..b757d0c4c79 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,162 +45,133 @@ impl Generator for Nushell { } } -struct Argument<'a, 'b> { - arg: &'a Arg, - name: &'b str, - possible_values: Vec, -} - -impl<'a, 'b> Argument<'a, 'b> { - fn new(arg: &'a Arg, name: &'b str) -> Self { - let possible_values = arg.get_possible_values(); +fn append_value_completion_and_help( + arg: &Arg, + name: &str, + possible_values: &Vec, + s: &mut String, +) { + let takes_values = arg + .get_num_args() + .map(|r| r.takes_values()) + .unwrap_or(false); + + if takes_values { + s.push_str(": string"); + + if !possible_values.is_empty() { + s.push_str(format!(r#"@"nu-complete {} {}""#, name, arg.get_id()).as_str()) + } + } - Self { - arg, - name, - possible_values, + if let Some(help) = arg.get_help() { + let indent: usize = 30; + let mut width = 0; + if let Some(line) = s.lines().last() { + width = indent.saturating_sub(line.len()); } + s.push_str(format!("{:>width$}# {}", ' ', help).as_str()); } - fn takes_values(&self) -> bool { - self.arg - .get_num_args() - .map(|r| r.takes_values()) - .unwrap_or(false) + s.push('\n'); +} + +fn append_value_completion_defs(arg: &Arg, name: &str, s: &mut String) { + let possible_values = arg.get_possible_values(); + if possible_values.is_empty() { + return; } - fn append_type_and_help(&self, s: &mut String) { - if self.takes_values() { - s.push_str(": string"); + s.push_str(format!(r#" def "nu-complete {} {}" [] {{"#, name, arg.get_id()).as_str()); + s.push_str("\n ["); - if !self.possible_values.is_empty() { - s.push_str( - format!(r#"@"nu-complete {} {}""#, self.name, self.arg.get_id()).as_str(), - ) - } + for value in possible_values { + let vname = value.get_name(); + if vname.contains(|c: char| c.is_whitespace()) { + s.push_str(format!(r#" "\"{}\"""#, vname).as_str()); + } else { + s.push_str(format!(r#" "{}""#, vname).as_str()); } + } - if let Some(help) = self.arg.get_help() { - let max: usize = 30; - let mut width = 0; - if let Some(line) = s.lines().last() { - width = max.saturating_sub(line.len()); - } - s.push_str(format!("{:>width$}# {}", ' ', help,).as_str()); - } + s.push_str(" ]\n }\n\n"); +} - s.push('\n'); - } +fn append_argument(arg: &Arg, name: &str, s: &mut String) { + let possible_values = arg.get_possible_values(); - fn get_values_completion(&self) -> Option { - if self.possible_values.is_empty() { - return None; - } + if arg.is_positional() { + // rest arguments + if matches!(arg.get_action(), ArgAction::Append) { + s.push_str(format!(" ...{}", arg.get_id()).as_str()); + } else { + s.push_str(format!(" {}", arg.get_id()).as_str()); - let mut s = format!( - r#" def "nu-complete {} {}" [] {{"#, - self.name, - self.arg.get_id() - ); - s.push_str("\n ["); - - for value in &self.possible_values { - let name = value.get_name(); - if name.contains(|c: char| c.is_whitespace()) { - s.push_str(format!(r#" "\"{}\"""#, name).as_str()); - } else { - s.push_str(format!(r#" "{}""#, name).as_str()); + if !arg.is_required_set() { + s.push('?'); } } - s.push_str(" ]\n }\n\n"); + append_value_completion_and_help(arg, name, &possible_values, s); - Some(s) + return; } -} -impl ToString for Argument<'_, '_> { - fn to_string(&self) -> String { - let mut s = String::new(); + let shorts = arg.get_short_and_visible_aliases(); + let longs = arg.get_long_and_visible_aliases(); - if self.arg.is_positional() { - // rest arguments - if matches!(self.arg.get_action(), ArgAction::Append) { - s.push_str(format!(" ...{}", self.arg.get_id()).as_str()); - } else { - s.push_str(format!(" {}", self.arg.get_id()).as_str()); - - if !self.arg.is_required_set() { - s.push('?'); + match shorts { + Some(shorts) => match longs { + Some(longs) => { + // short options and long options + s.push_str( + format!( + " --{}(-{})", + longs.first().expect("At least one long option expected"), + shorts.first().expect("At lease one short option expected") + ) + .as_str(), + ); + append_value_completion_and_help(arg, name, &possible_values, s); + + // long alias + for long in longs.iter().skip(1) { + s.push_str(format!(" --{}", long).as_str()); + append_value_completion_and_help(arg, name, &possible_values, s); } - } - - self.append_type_and_help(&mut s); - return s; - } - - let shorts = self.arg.get_short_and_visible_aliases(); - let longs = self.arg.get_long_and_visible_aliases(); - - match shorts { - Some(shorts) => match longs { - Some(longs) => { - // short options and long options - s.push_str( - format!( - " --{}(-{})", - longs.first().expect("At least one long option expected"), - shorts.first().expect("At lease one short option expected") - ) - .as_str(), - ); - self.append_type_and_help(&mut s); - - // long alias - for long in longs.iter().skip(1) { - s.push_str(format!(" --{}", long).as_str()); - self.append_type_and_help(&mut s); - } - - // short alias - for short in shorts.iter().skip(1) { - s.push_str(format!(" -{}", short).as_str()); - self.append_type_and_help(&mut s); - } + // short alias + for short in shorts.iter().skip(1) { + s.push_str(format!(" -{}", short).as_str()); + append_value_completion_and_help(arg, name, &possible_values, s); } - None => { - // short options only - for short in shorts { - s.push_str(format!(" -{}", short).as_str()); - self.append_type_and_help(&mut s); - } + } + None => { + // short options only + for short in shorts { + s.push_str(format!(" -{}", short).as_str()); + append_value_completion_and_help(arg, name, &possible_values, s); } - }, - None => match longs { - Some(longs) => { - // long options only - for long in longs { - s.push_str(format!(" --{}", long).as_str()); - self.append_type_and_help(&mut s); - } + } + }, + None => match longs { + Some(longs) => { + // long options only + for long in longs { + s.push_str(format!(" --{}", long).as_str()); + append_value_completion_and_help(arg, name, &possible_values, s); } - None => unreachable!("No short or long optioin found"), - }, - } - - s + } + None => unreachable!("No short or long options found"), + }, } } fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: bool) { let name = cmd.get_bin_name().expect("Failed to get bin name"); - for value in cmd - .get_arguments() - .filter_map(|arg| Argument::new(arg, name).get_values_completion()) - { - completions.push_str(&value); + for arg in cmd.get_arguments() { + append_value_completion_defs(arg, name, completions); } if let Some(about) = cmd.get_about() { @@ -213,11 +184,8 @@ fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: b completions.push_str(format!(" export extern {} [\n", name).as_str()); } - for s in cmd - .get_arguments() - .map(|arg| Argument::new(arg, name).to_string()) - { - completions.push_str(&s); + for arg in cmd.get_arguments() { + append_argument(arg, name, completions); } completions.push_str(" ]\n\n"); From 8e44f4f77c4077d8267c2cd9fdec668a802500c7 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Sat, 5 Nov 2022 22:55:33 +0800 Subject: [PATCH 28/42] chore: release 0.1.8 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 67b94de6498..bb85794c7d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap_complete_nushell" authors = [ "nibon7 " ] -version = "0.1.7" +version = "0.1.8" edition = "2021" license = "MIT" description = "A generator library used with clap for Nushell completion scripts" From b5d817113afe1b6dfcb0656eaf45697c52b45dbb Mon Sep 17 00:00:00 2001 From: nibon7 Date: Mon, 7 Nov 2022 17:42:57 +0800 Subject: [PATCH 29/42] docs: update readme --- README.md | 3 ++- scripts/gen_readme.nu | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index abb6b12317d..6c64c6240de 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`] [![Crates.io](https://img.shields.io/crates/d/clap_complete_nushell)](https://crates.io/crates/clap_complete_nushell) [![License](https://img.shields.io/github/license/nibon7/clap_complete_nushell)](LICENSE) [![docs.rs](https://img.shields.io/docsrs/clap_complete_nushell)](https://docs.rs/clap_complete_nushell) -[![Build Status](https://img.shields.io/github/workflow/status/nibon7/clap_complete_nushell/CI/master)](https://github.com/nibon7/clap_complete_nushell/actions/workflows/ci.yaml?query=branch%3Amaster) +[![Build Status](https://img.shields.io/github/workflow/status/nibon7/clap_complete_nushell/CI/main)](https://github.com/nibon7/clap_complete_nushell/actions/workflows/ci.yaml?query=branch%3Amain) +[![GitHub last commit](https://img.shields.io/github/last-commit/nibon7/clap_complete_nushell)](https://github.com/nibon7/clap_complete_nushell/commits/main) ## Examples diff --git a/scripts/gen_readme.nu b/scripts/gen_readme.nu index 87c97d5295f..66a15070480 100755 --- a/scripts/gen_readme.nu +++ b/scripts/gen_readme.nu @@ -13,16 +13,16 @@ def generate_preamble [user: string, repo: string] { let crates = "https://crates.io" let docs = "https://docs.rs" let github = "https://github.com" + let branch = "main" - $"# ($repo) - -Generates [Nushell]\((generate_url $github nushell/nushell)\) completions for [`clap`]\((generate_url $github clap-rs/clap)\) based CLIs - + $"# ($repo)\n +Generates [Nushell]\((generate_url $github nushell/nushell)\) completions for [`clap`]\((generate_url $github clap-rs/clap)\) based CLIs\n [![Crates.io]\((generate_url $baseurl crates/v $repo)\)]\((generate_url $crates crates $repo)\) [![Crates.io]\((generate_url $baseurl crates/d $repo)\)]\((generate_url $crates crates $repo)\) [![License]\((generate_url $baseurl github/license $user)/(generate_url $repo)\)]\(LICENSE\) [![docs.rs]\((generate_url $baseurl docsrs $repo)\)]\((generate_url $docs $repo)\) -[![Build Status]\((generate_url $baseurl github/workflow/status $user $repo CI/master)\)]\((generate_url $github $user $repo actions/workflows/ci.yaml?query=branch%3Amaster)\)\n" +[![Build Status]\((generate_url $baseurl github/workflow/status $user $repo CI $branch)\)]\((generate_url $github $user $repo actions/workflows/ci.yaml?query=branch%3A($branch))\) +[![GitHub last commit]\((generate_url $baseurl github/last-commit $user $repo)\)]\((generate_url $github $user $repo commits/($branch))\)\n" } def code_to_md [title: string, lang: string, code: string] { From 0b9a11ac4b64a4aa88dca0381a77a89973c1945d Mon Sep 17 00:00:00 2001 From: nibon7 Date: Wed, 9 Nov 2022 23:15:30 +0800 Subject: [PATCH 30/42] ci: update setup-nu --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fd1b164ea7f..8f3a1de2195 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - - uses: hustcer/setup-nu@v2.1 + - uses: hustcer/setup-nu@v3 with: check-latest: true env: From 21f9e78a09a72d49d823811d182c83d7f367072f Mon Sep 17 00:00:00 2001 From: nibon7 Date: Fri, 11 Nov 2022 22:59:00 +0800 Subject: [PATCH 31/42] ci: update CI --- .github/workflows/ci.yaml | 53 ------------------------------- .github/workflows/ci.yml | 66 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 53 deletions(-) delete mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 8f3a1de2195..00000000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: CI -on: [push, pull_request] - -jobs: - test: - name: Test - runs-on: ${{ matrix.os }} - strategy: - matrix: - build: [stable, beta, nightly] - include: - - build: stable - os: ubuntu-latest - rust: stable - - build: beta - os: ubuntu-latest - rust: beta - - build: nightly - os: ubuntu-latest - rust: nightly - steps: - - uses: actions/checkout@master - - name: Install Rust (rustup) - run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} - shell: bash - - run: cargo build --examples -v --workspace - - run: cargo doc -v --workspace - - run: cargo test -v --workspace - - run: cargo clean - - rustfmt: - name: Rustfmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Install Rust - run: rustup update stable && rustup default stable && rustup component add rustfmt - - run: cargo fmt -- --check - - check: - name: Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - uses: hustcer/setup-nu@v3 - with: - check-latest: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: | - echo "Nushell version: $(nu -c '(version).version')" - for i in tests/snapshots/*.nu; do nu -c "print -n $'(ansi green)Checking $i ...'; ansi reset; source $i"; done - shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..4ca4cbcd33f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: CI +on: + push: + pull_request: + schedule: + - cron: '00 04 * * *' + +env: + CARGO_TERM_COLOR: always + +jobs: + lints: + name: Lints + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/checkout@v2 + + - name: Install latest stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: rustfmt, clippy + override: true + + - name: Rustfmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + - name: Check + uses: actions-rs/cargo@v1 + with: + command: check + args: --workspace --all-targets --examples --tests + + - name: Clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --workspace --all-targets --examples --tests -- -D warnings + + - name: Test + uses: actions-rs/cargo@v1 + with: + command: test + args: --workspace --all-targets --all-features + + check_scripts: + name: Check nushell scripts + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: hustcer/setup-nu@v3 + with: + check-latest: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: | + echo "Nushell version: $(nu -c '(version).version')" + for i in tests/snapshots/*.nu; do nu -c "print -n $'(ansi green)Checking $i ...'; ansi reset; source $i"; done + shell: bash From 8a75bfd5aa2c5ba12e9892267528c29d91402fb4 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Sat, 19 Nov 2022 13:06:03 +0800 Subject: [PATCH 32/42] docs: update readme --- README.md | 2 +- scripts/gen_readme.nu | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6c64c6240de..79022ac29c6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`] [![Crates.io](https://img.shields.io/crates/d/clap_complete_nushell)](https://crates.io/crates/clap_complete_nushell) [![License](https://img.shields.io/github/license/nibon7/clap_complete_nushell)](LICENSE) [![docs.rs](https://img.shields.io/docsrs/clap_complete_nushell)](https://docs.rs/clap_complete_nushell) -[![Build Status](https://img.shields.io/github/workflow/status/nibon7/clap_complete_nushell/CI/main)](https://github.com/nibon7/clap_complete_nushell/actions/workflows/ci.yaml?query=branch%3Amain) +[![Build Status](https://img.shields.io/github/workflow/status/nibon7/clap_complete_nushell/CI/main)](https://github.com/nibon7/clap_complete_nushell/actions/workflows/ci.yml?query=branch%3Amain) [![GitHub last commit](https://img.shields.io/github/last-commit/nibon7/clap_complete_nushell)](https://github.com/nibon7/clap_complete_nushell/commits/main) ## Examples diff --git a/scripts/gen_readme.nu b/scripts/gen_readme.nu index 66a15070480..4e8a5fe24c6 100755 --- a/scripts/gen_readme.nu +++ b/scripts/gen_readme.nu @@ -21,8 +21,8 @@ Generates [Nushell]\((generate_url $github nushell/nushell)\) completions for [` [![Crates.io]\((generate_url $baseurl crates/d $repo)\)]\((generate_url $crates crates $repo)\) [![License]\((generate_url $baseurl github/license $user)/(generate_url $repo)\)]\(LICENSE\) [![docs.rs]\((generate_url $baseurl docsrs $repo)\)]\((generate_url $docs $repo)\) -[![Build Status]\((generate_url $baseurl github/workflow/status $user $repo CI $branch)\)]\((generate_url $github $user $repo actions/workflows/ci.yaml?query=branch%3A($branch))\) -[![GitHub last commit]\((generate_url $baseurl github/last-commit $user $repo)\)]\((generate_url $github $user $repo commits/($branch))\)\n" +[![Build Status]\((generate_url $baseurl github/workflow/status $user $repo CI $branch)\)]\((generate_url $github $user $repo actions/workflows/ci.yml?query=branch%3A($branch))\) +[![GitHub last commit]\((generate_url $baseurl github/last-commit $user $repo)\)]\((generate_url $github $user $repo commits/($branch))\)\n\n" } def code_to_md [title: string, lang: string, code: string] { @@ -39,8 +39,8 @@ def generate_md [file: path] { let rust_example = (code_to_md myapp.rs rust $rust_code) let nu_example = (code_to_md myapp.nu nu $nu_code) - |generate_preamble $user $repo - |[$in] + generate_preamble $user $repo + |lines |append "## Examples\n" |append $rust_example |append $nu_example From 262de4abb2f68eeea23eabaa9c12184b1441208f Mon Sep 17 00:00:00 2001 From: nibon7 Date: Mon, 21 Nov 2022 19:29:53 +0800 Subject: [PATCH 33/42] chore: update --- src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b757d0c4c79..5b6c49a9a3e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,10 +66,11 @@ fn append_value_completion_and_help( if let Some(help) = arg.get_help() { let indent: usize = 30; - let mut width = 0; - if let Some(line) = s.lines().last() { - width = indent.saturating_sub(line.len()); - } + let width = match s.lines().last() { + Some(line) => indent.saturating_sub(line.len()), + None => 0, + }; + s.push_str(format!("{:>width$}# {}", ' ', help).as_str()); } From fdcb9fe78bde207d56c4afcce79a3f007c9e6cec Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 24 Jan 2023 16:15:08 +0800 Subject: [PATCH 34/42] docs: update build badge --- README.md | 3 ++- scripts/gen_readme.nu | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 79022ac29c6..b6c3776617c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`] [![Crates.io](https://img.shields.io/crates/d/clap_complete_nushell)](https://crates.io/crates/clap_complete_nushell) [![License](https://img.shields.io/github/license/nibon7/clap_complete_nushell)](LICENSE) [![docs.rs](https://img.shields.io/docsrs/clap_complete_nushell)](https://docs.rs/clap_complete_nushell) -[![Build Status](https://img.shields.io/github/workflow/status/nibon7/clap_complete_nushell/CI/main)](https://github.com/nibon7/clap_complete_nushell/actions/workflows/ci.yml?query=branch%3Amain) +[![Build Status](https://img.shields.io/github/actions/workflow/status/nibon7/clap_complete_nushell/ci.yml)](https://github.com/nibon7/clap_complete_nushell/actions/workflows/ci.yml?query=branch%3Amain) [![GitHub last commit](https://img.shields.io/github/last-commit/nibon7/clap_complete_nushell)](https://github.com/nibon7/clap_complete_nushell/commits/main) ## Examples @@ -63,6 +63,7 @@ fn main() { generate(Nushell, &mut cmd, "myapp", &mut io::stdout()); } + ``` ### myapp.nu diff --git a/scripts/gen_readme.nu b/scripts/gen_readme.nu index 4e8a5fe24c6..d4e7bf138e0 100755 --- a/scripts/gen_readme.nu +++ b/scripts/gen_readme.nu @@ -21,12 +21,12 @@ Generates [Nushell]\((generate_url $github nushell/nushell)\) completions for [` [![Crates.io]\((generate_url $baseurl crates/d $repo)\)]\((generate_url $crates crates $repo)\) [![License]\((generate_url $baseurl github/license $user)/(generate_url $repo)\)]\(LICENSE\) [![docs.rs]\((generate_url $baseurl docsrs $repo)\)]\((generate_url $docs $repo)\) -[![Build Status]\((generate_url $baseurl github/workflow/status $user $repo CI $branch)\)]\((generate_url $github $user $repo actions/workflows/ci.yml?query=branch%3A($branch))\) +[![Build Status]\((generate_url $baseurl github/actions/workflow/status $user $repo ci.yml)\)]\((generate_url $github $user $repo actions/workflows/ci.yml?query=branch%3A($branch))\) [![GitHub last commit]\((generate_url $baseurl github/last-commit $user $repo)\)]\((generate_url $github $user $repo commits/($branch))\)\n\n" } def code_to_md [title: string, lang: string, code: string] { - $"### ($title)\n\n```($lang)\n($code)```\n" + $"### ($title)\n\n```($lang)\n($code)\n```\n" } def generate_md [file: path] { @@ -45,7 +45,7 @@ def generate_md [file: path] { |append $rust_example |append $nu_example |str join "\n" - |save -r README.md + |save -r -f README.md } generate_md $example_file From 8abc8cef0a958383f887f5d4186e6dba3de0c501 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 24 Jan 2023 16:26:54 +0800 Subject: [PATCH 35/42] ci: fix tests --- .gitignore | 1 - Cargo.lock | 269 ++++++++++++++++++++++++++++ README.md | 8 +- tests/snapshots/aliases.nu | 2 +- tests/snapshots/feature_sample.nu | 4 +- tests/snapshots/quoting.nu | 2 +- tests/snapshots/special_commands.nu | 10 +- tests/snapshots/sub_subcommands.nu | 8 +- 8 files changed, 286 insertions(+), 18 deletions(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index 4fffb2f89cb..ea8c4bf7f35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ /target -/Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000000..e54cf955408 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,269 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "cc" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" + +[[package]] +name = "clap" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8d93d855ce6a0aa87b8473ef9169482f40abaa2e9e0993024c35c902cbd5920" +dependencies = [ + "bitflags", + "clap_lex", +] + +[[package]] +name = "clap_complete" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6540eedc41f8a5a76cf3d8d458057dcdf817be4158a55b5f861f7a5483de75" +dependencies = [ + "clap", +] + +[[package]] +name = "clap_complete_nushell" +version = "0.1.8" +dependencies = [ + "clap", + "clap_complete", + "snapbox", +] + +[[package]] +name = "clap_lex" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "concolor" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "318d6c16e73b3a900eb212ad6a82fc7d298c5ab8184c7a9998646455bc474a16" +dependencies = [ + "bitflags", + "concolor-query", + "is-terminal", +] + +[[package]] +name = "concolor-query" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82a90734b3d5dcf656e7624cca6bce9c3a90ee11f900e80141a7427ccfb3d317" + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "is-terminal" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +dependencies = [ + "hermit-abi", + "io-lifetimes", + "rustix", + "windows-sys", +] + +[[package]] +name = "libc" +version = "0.2.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "os_str_bytes" +version = "6.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" + +[[package]] +name = "rustix" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "similar" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" + +[[package]] +name = "snapbox" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34eced5a65e76d5a00047986a83c65f80dc666faa27b5138f331659e2ca6bcf5" +dependencies = [ + "concolor", + "normalize-line-endings", + "similar", + "snapbox-macros", + "yansi", +] + +[[package]] +name = "snapbox-macros" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "485e65c1203eb37244465e857d15a26d3a85a5410648ccb53b18bd44cb3a7336" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" diff --git a/README.md b/README.md index b6c3776617c..7852cda6425 100644 --- a/README.md +++ b/README.md @@ -82,18 +82,18 @@ module completions { --conf # some config file -C # some config file choice?: string@"nu-complete myapp choice" - --version(-V) # Print version information + --version(-V) # Print version ] # tests things export extern "myapp test" [ --case: string # the case to test - --version(-V) # Print version information + --version(-V) # Print version ] # top level subcommand export extern "myapp some_cmd" [ - --version(-V) # Print version information + --version(-V) # Print version ] def "nu-complete myapp some_cmd sub_cmd config" [] { @@ -103,7 +103,7 @@ module completions { # sub-subcommand export extern "myapp some_cmd sub_cmd" [ --config: string@"nu-complete myapp some_cmd sub_cmd config" # the other case to test - --version(-V) # Print version information + --version(-V) # Print version ] } diff --git a/tests/snapshots/aliases.nu b/tests/snapshots/aliases.nu index 39bf07b9b71..60dd5071c8f 100644 --- a/tests/snapshots/aliases.nu +++ b/tests/snapshots/aliases.nu @@ -9,7 +9,7 @@ module completions { --opt: string # cmd option -O: string # cmd option positional?: string - --version(-V) # Print version information + --version(-V) # Print version ] } diff --git a/tests/snapshots/feature_sample.nu b/tests/snapshots/feature_sample.nu index 8796745ff1f..00d27f3196c 100644 --- a/tests/snapshots/feature_sample.nu +++ b/tests/snapshots/feature_sample.nu @@ -11,13 +11,13 @@ module completions { --conf # some config file -C # some config file choice?: string@"nu-complete my-app choice" - --version(-V) # Print version information + --version(-V) # Print version ] # tests things export extern "my-app test" [ --case: string # the case to test - --version(-V) # Print version information + --version(-V) # Print version ] } diff --git a/tests/snapshots/quoting.nu b/tests/snapshots/quoting.nu index 3d4f1408677..3ed1ddc43e7 100644 --- a/tests/snapshots/quoting.nu +++ b/tests/snapshots/quoting.nu @@ -7,7 +7,7 @@ module completions { --backslash # Avoid '\n' --brackets # List packages [filter] --expansions # Execute the shell command with $SHELL - --version(-V) # Print version information + --version(-V) # Print version ] # Can be 'always', 'auto', or 'never' diff --git a/tests/snapshots/special_commands.nu b/tests/snapshots/special_commands.nu index 6df906e93c0..784ac40bc63 100644 --- a/tests/snapshots/special_commands.nu +++ b/tests/snapshots/special_commands.nu @@ -11,28 +11,28 @@ module completions { --conf # some config file -C # some config file choice?: string@"nu-complete my-app choice" - --version(-V) # Print version information + --version(-V) # Print version ] # tests things export extern "my-app test" [ --case: string # the case to test - --version(-V) # Print version information + --version(-V) # Print version ] # tests other things export extern "my-app some_cmd" [ --config: string # the other case to test ...path: string - --version(-V) # Print version information + --version(-V) # Print version ] export extern "my-app some-cmd-with-hyphens" [ - --version(-V) # Print version information + --version(-V) # Print version ] export extern "my-app some-hidden-cmd" [ - --version(-V) # Print version information + --version(-V) # Print version ] } diff --git a/tests/snapshots/sub_subcommands.nu b/tests/snapshots/sub_subcommands.nu index d0e7f8fe0fc..ce337a2f5c2 100644 --- a/tests/snapshots/sub_subcommands.nu +++ b/tests/snapshots/sub_subcommands.nu @@ -11,18 +11,18 @@ module completions { --conf # some config file -C # some config file choice?: string@"nu-complete my-app choice" - --version(-V) # Print version information + --version(-V) # Print version ] # tests things export extern "my-app test" [ --case: string # the case to test - --version(-V) # Print version information + --version(-V) # Print version ] # top level subcommand export extern "my-app some_cmd" [ - --version(-V) # Print version information + --version(-V) # Print version ] def "nu-complete my-app some_cmd sub_cmd config" [] { @@ -32,7 +32,7 @@ module completions { # sub-subcommand export extern "my-app some_cmd sub_cmd" [ --config: string@"nu-complete my-app some_cmd sub_cmd config" # the other case to test - --version(-V) # Print version information + --version(-V) # Print version ] } From 9979402fbebdd6729ce0973a857174f3d4870d22 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 24 Jan 2023 16:40:49 +0800 Subject: [PATCH 36/42] chore: release 0.1.9 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bb85794c7d8..32d6c9331e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap_complete_nushell" authors = [ "nibon7 " ] -version = "0.1.8" +version = "0.1.9" edition = "2021" license = "MIT" description = "A generator library used with clap for Nushell completion scripts" From a4e7f5b25840faa381e9972c06c6e5dae8cf6f9d Mon Sep 17 00:00:00 2001 From: nibon7 Date: Fri, 27 Jan 2023 19:39:01 +0800 Subject: [PATCH 37/42] ci: clippy fix --- src/lib.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 5b6c49a9a3e..8adf7852031 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,7 +23,7 @@ pub struct Nushell; impl Generator for Nushell { fn file_name(&self, name: &str) -> String { - format!("{}.nu", name) + format!("{name}.nu") } fn generate(&self, cmd: &Command, buf: &mut dyn std::io::Write) { @@ -89,9 +89,9 @@ fn append_value_completion_defs(arg: &Arg, name: &str, s: &mut String) { for value in possible_values { let vname = value.get_name(); if vname.contains(|c: char| c.is_whitespace()) { - s.push_str(format!(r#" "\"{}\"""#, vname).as_str()); + s.push_str(format!(r#" "\"{vname}\"""#).as_str()); } else { - s.push_str(format!(r#" "{}""#, vname).as_str()); + s.push_str(format!(r#" "{vname}""#).as_str()); } } @@ -137,20 +137,20 @@ fn append_argument(arg: &Arg, name: &str, s: &mut String) { // long alias for long in longs.iter().skip(1) { - s.push_str(format!(" --{}", long).as_str()); + s.push_str(format!(" --{long}").as_str()); append_value_completion_and_help(arg, name, &possible_values, s); } // short alias for short in shorts.iter().skip(1) { - s.push_str(format!(" -{}", short).as_str()); + s.push_str(format!(" -{short}").as_str()); append_value_completion_and_help(arg, name, &possible_values, s); } } None => { // short options only for short in shorts { - s.push_str(format!(" -{}", short).as_str()); + s.push_str(format!(" -{short}").as_str()); append_value_completion_and_help(arg, name, &possible_values, s); } } @@ -159,7 +159,7 @@ fn append_argument(arg: &Arg, name: &str, s: &mut String) { Some(longs) => { // long options only for long in longs { - s.push_str(format!(" --{}", long).as_str()); + s.push_str(format!(" --{long}").as_str()); append_value_completion_and_help(arg, name, &possible_values, s); } } @@ -176,13 +176,13 @@ fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: b } if let Some(about) = cmd.get_about() { - completions.push_str(format!(" # {}\n", about).as_str()); + completions.push_str(format!(" # {about}\n").as_str()); } if is_subcommand { - completions.push_str(format!(" export extern \"{}\" [\n", name).as_str()); + completions.push_str(format!(" export extern \"{name}\" [\n").as_str()); } else { - completions.push_str(format!(" export extern {} [\n", name).as_str()); + completions.push_str(format!(" export extern {name} [\n").as_str()); } for arg in cmd.get_arguments() { From e130c8a3901b2175f93dfd4788d57a01906af77b Mon Sep 17 00:00:00 2001 From: nibon7 Date: Fri, 27 Jan 2023 19:50:11 +0800 Subject: [PATCH 38/42] chore: release 0.1.10 --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e54cf955408..cbb0b066eee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,9 +16,9 @@ checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" [[package]] name = "clap" -version = "4.1.3" +version = "4.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8d93d855ce6a0aa87b8473ef9169482f40abaa2e9e0993024c35c902cbd5920" +checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" dependencies = [ "bitflags", "clap_lex", @@ -35,7 +35,7 @@ dependencies = [ [[package]] name = "clap_complete_nushell" -version = "0.1.8" +version = "0.1.10" dependencies = [ "clap", "clap_complete", diff --git a/Cargo.toml b/Cargo.toml index 32d6c9331e0..8d2e2eb60a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap_complete_nushell" authors = [ "nibon7 " ] -version = "0.1.9" +version = "0.1.10" edition = "2021" license = "MIT" description = "A generator library used with clap for Nushell completion scripts" From 6e586e09237eebb023e89328e6eaf8b0c4d1dbb1 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 23 May 2023 13:09:11 +0800 Subject: [PATCH 39/42] test: add test cases for completions --- .github/workflows/ci.yml | 15 - Cargo.lock | 3690 ++++++++++++++++++++++++++++++++++++-- Cargo.toml | 6 + tests/completion.rs | 312 ++++ 4 files changed, 3894 insertions(+), 129 deletions(-) create mode 100644 tests/completion.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ca4cbcd33f..27148093e45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,18 +49,3 @@ jobs: with: command: test args: --workspace --all-targets --all-features - - check_scripts: - name: Check nushell scripts - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: hustcer/setup-nu@v3 - with: - check-latest: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: | - echo "Nushell version: $(nu -c '(version).version')" - for i in tests/snapshots/*.nu; do nu -c "print -n $'(ansi green)Checking $i ...'; ansi reset; source $i"; done - shell: bash diff --git a/Cargo.lock b/Cargo.lock index cbb0b066eee..43ffeb36f46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,186 +2,3493 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + +[[package]] +name = "alphanumeric-sort" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81149050d254e2b758c80dcf55949e5c45482e0c9cb3670b1c4b48eb51791f8e" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi-str" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b1ed1c166829a0ccb5d79caa0f75cb4abd4adb2ce2c096755b7ad5ffdb0990" +dependencies = [ + "ansitok", +] + +[[package]] +name = "ansitok" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "220044e6a1bb31ddee4e3db724d29767f352de47445a6cd75e1a173142136c83" +dependencies = [ + "nom", + "vte", +] + +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + +[[package]] +name = "anstyle-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f1e31e207a6b8fb791a38ea3105e6cb541f55e4d029902d3039a4ad07cc4105" + +[[package]] +name = "bindgen" +version = "0.59.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "brownstone" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5839ee4f953e811bfdcf223f509cb2c6a3e1447959b0bff459405575bc17f22" +dependencies = [ + "arrayvec 0.7.2", +] + +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", +] + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "byte-unit" +version = "4.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da78b32057b8fdfc352504708feeba7216dcd65a2c9ab02978cbd288d1279b6c" +dependencies = [ + "serde", + "utf8-width", +] + +[[package]] +name = "bytecount" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytesize" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" + +[[package]] +name = "calamine" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6381d1037ee9b8a6c8eb97936add0331a1aabd148d5b6f35f1cda6e5dec44f40" +dependencies = [ + "byteorder", + "codepage", + "encoding_rs", + "log", + "quick-xml 0.25.0", + "serde", + "zip", +] + +[[package]] +name = "cassowary" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "pure-rust-locales", + "serde", + "time 0.1.45", + "wasm-bindgen", + "winapi 0.3.9", +] + +[[package]] +name = "chrono-humanize" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32dce1ea1988dbdf9f9815ff11425828523bd2a134ec0805d2ac8af26ee6096e" +dependencies = [ + "chrono", +] + +[[package]] +name = "chrono-tz" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9cc2b23599e6d7479755f3594285efb3f74a1bdca7a7374948bc831e23a552" +dependencies = [ + "chrono", + "chrono-tz-build", + "phf", +] + +[[package]] +name = "chrono-tz-build" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9998fb9f7e9b2111641485bf8beb32f92945f97f92a3d061f744cfef335f751" +dependencies = [ + "parse-zoneinfo", + "phf", + "phf_codegen", +] + +[[package]] +name = "clang-sys" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" +dependencies = [ + "anstyle", + "bitflags", + "clap_lex", +] + +[[package]] +name = "clap_complete" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a04ddfaacc3bc9e6ea67d024575fafc2a813027cf374b8f24f7bc233c6b6be12" +dependencies = [ + "clap", +] + +[[package]] +name = "clap_complete_nushell" +version = "0.1.10" +dependencies = [ + "clap", + "clap_complete", + "nu-cli", + "nu-command", + "nu-parser", + "nu-protocol", + "nu-test-support", + "reedline", + "snapbox", +] + +[[package]] +name = "clap_lex" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "codepage" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b0e9222c0cdf2c6ac27d73f664f9520266fa911c3106329d359f8861cb8bde9" +dependencies = [ + "encoding_rs", +] + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "console" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.45.0", +] + +[[package]] +name = "const_format" +version = "0.2.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7309d9b4d3d2c0641e018d449232f2e28f1b22933c137f157d3dbc14228b8c0e" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f47bf7270cf70d370f8f98c1abb6d2d4cf60a6845d30e05bfb90c6568650" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossterm" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13" +dependencies = [ + "bitflags", + "crossterm_winapi", + "libc", + "mio 0.8.6", + "parking_lot", + "serde", + "signal-hook", + "signal-hook-mio", + "winapi 0.3.9", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "csv" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +dependencies = [ + "memchr", +] + +[[package]] +name = "dialoguer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +dependencies = [ + "console", + "fuzzy-matcher", + "shell-words", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] + +[[package]] +name = "dtparse" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd3b6a23c50eb90a80bdb748042620328617e76276b99dc5c97906e47f807c3" +dependencies = [ + "chrono", + "lazy_static", + "num-traits", + "rust_decimal", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "erased-serde" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2b0c2380453a92ea8b6c8e5f64ecaafccddde8ceab55ff7a8ac1029f894569" +dependencies = [ + "serde", +] + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fancy-regex" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" +dependencies = [ + "bit-set", + "regex", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fd-lock" +version = "3.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ae6b3d9530211fb3b12a95374b8b0823be812f53d09e18c5675c0146b09642" +dependencies = [ + "cfg-if 1.0.0", + "rustix 0.37.19", + "windows-sys 0.48.0", +] + +[[package]] +name = "filesize" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12d741e2415d4e2e5bd1c1d00409d1a8865a57892c2d689b504365655d237d43" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "filetime" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.2.16", + "windows-sys 0.48.0", +] + +[[package]] +name = "flate2" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "fsevent" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" +dependencies = [ + "bitflags", + "fsevent-sys", +] + +[[package]] +name = "fsevent-sys" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" +dependencies = [ + "libc", +] + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "fuzzy-matcher" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54614a3312934d066701a80f20f15fa3b56d67ac7722b39eea5b4c9dd1d66c94" +dependencies = [ + "thread_local", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getset" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ghost" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e77ac7b51b8e6313251737fcef4b1c01a2ea102bde68415b62c0ee9268fec357" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hamcrest2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f837c62de05dc9cc71ff6486cd85de8856a330395ae338a04bfcefe5e91075" +dependencies = [ + "num", + "regex", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] + +[[package]] +name = "hashlink" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0761a1b9491c4f2e3d66aa0f62d0fba0af9a0e2852e4d48ea506632a4b56e6aa" +dependencies = [ + "hashbrown 0.13.2", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "htmlescape" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" + +[[package]] +name = "iana-time-zone" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indent_write" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indicatif" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" +dependencies = [ + "console", + "number_prefix", + "portable-atomic 0.3.20", + "unicode-width", +] + +[[package]] +name = "inotify" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" +dependencies = [ + "bitflags", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "inventory" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0539b5de9241582ce6bd6b0ba7399313560151e58c9aaf8b74b711b1bdce644" +dependencies = [ + "ghost", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-root" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04a4202a60e86f1c9702706bb42270dadd333f2db7810157563c86f17af3c873" +dependencies = [ + "users 0.10.0", + "winapi 0.3.9", +] + +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix 0.37.19", + "windows-sys 0.48.0", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + +[[package]] +name = "is_ci" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" + +[[package]] +name = "is_debug" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06d198e9919d9822d5f7083ba8530e04de87841eaf21ead9af8f2304efd57c89" + +[[package]] +name = "is_executable" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa9acdc6d67b75e626ad644734e8bc6df893d9cd2a834129065d3dd6158ea9c8" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "joinery" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" + +[[package]] +name = "js-sys" +version = "0.3.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if 1.0.0", + "winapi 0.3.9", +] + +[[package]] +name = "libproc" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b799ad155d75ce914c467ee5627b62247c20d4aedbd446f821484cebf3cded7" +dependencies = [ + "bindgen", + "errno 0.2.8", + "libc", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29f835d03d717946d28b1d1ed632eb6f0e24a299388ee623d0c23118d3e8a7fa" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +dependencies = [ + "serde", +] + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "lru" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03f1160296536f10c833a82dca22267d5486734230d47bf00bf435885814ba1e" +dependencies = [ + "hashbrown 0.13.2", +] + +[[package]] +name = "lscolors" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a9df1d1fb6d9e92fa043e9eb9a3ecf6892c7b542bae5137cd1e419e40aa8bf" +dependencies = [ + "nu-ansi-term", +] + +[[package]] +name = "mach2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" +dependencies = [ + "libc", +] + +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miette" +version = "5.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a236ff270093b0b67451bc50a509bd1bad302cb1d3c7d37d5efe931238581fa9" +dependencies = [ + "is-terminal", + "miette-derive", + "once_cell", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size 0.1.17", + "textwrap", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "5.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4901771e1d44ddb37964565c654a3223ba41a594d02b8da471cc4464912b5cfa" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +dependencies = [ + "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "mio" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.45.0", +] + +[[package]] +name = "mio-extras" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +dependencies = [ + "lazycell", + "log", + "mio 0.6.23", + "slab", +] + +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "net2" +version = "0.2.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "nix" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "libc", + "static_assertions", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom-supreme" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd3ae6c901f1959588759ff51c95d24b491ecb9ff91aa9c2ef4acc5b1dcab27" +dependencies = [ + "brownstone", + "indent_write", + "joinery", + "memchr", + "nom", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "notify" +version = "4.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257" +dependencies = [ + "bitflags", + "filetime", + "fsevent", + "fsevent-sys", + "inotify", + "libc", + "mio 0.6.23", + "mio-extras", + "walkdir", + "winapi 0.3.9", +] + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "nu-ansi-term" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df031e117bca634c262e9bd3173776844b6c17a90b3741c9163663b4385af76" +dependencies = [ + "windows-sys 0.45.0", +] + +[[package]] +name = "nu-cli" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "026a72e68144fc24d6a290d8c7a1601c4aeee3ac04ab9599179776847a3dd13e" +dependencies = [ + "atty", + "chrono", + "crossterm", + "fancy-regex", + "fuzzy-matcher", + "is_executable", + "log", + "miette", + "nu-ansi-term", + "nu-color-config", + "nu-command", + "nu-engine", + "nu-parser", + "nu-path", + "nu-protocol", + "nu-utils", + "once_cell", + "percent-encoding", + "reedline", + "sysinfo", + "thiserror", + "unicode-segmentation", +] + +[[package]] +name = "nu-cmd-lang" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa3cacbe9407dea1fbb13b5cc84c240d5e76af0e62f97f754de95c663234e61" +dependencies = [ + "fancy-regex", + "itertools", + "log", + "nu-ansi-term", + "nu-color-config", + "nu-engine", + "nu-parser", + "nu-protocol", + "nu-utils", + "shadow-rs", +] + +[[package]] +name = "nu-color-config" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed4196a9f7414cbd61ddbc9f1edf1b1d053fb749652e4bead7290bc35d2db481" +dependencies = [ + "nu-ansi-term", + "nu-engine", + "nu-json", + "nu-protocol", + "nu-utils", + "serde", +] + +[[package]] +name = "nu-command" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba922c35e40f3fd436fa1daff8ef7fe1f23a13f0106d038f40d8e421abea08ce" +dependencies = [ + "Inflector", + "alphanumeric-sort", + "atty", + "base64 0.21.1", + "byteorder", + "bytesize", + "calamine", + "chrono", + "chrono-humanize", + "chrono-tz", + "crossterm", + "csv", + "dialoguer", + "digest", + "dtparse", + "encoding_rs", + "fancy-regex", + "filesize", + "filetime", + "fs_extra", + "htmlescape", + "indexmap", + "indicatif", + "is-root", + "itertools", + "libc", + "log", + "lscolors", + "md-5", + "miette", + "mime", + "mime_guess", + "native-tls", + "notify", + "nu-ansi-term", + "nu-cmd-lang", + "nu-color-config", + "nu-engine", + "nu-explore", + "nu-glob", + "nu-json", + "nu-parser", + "nu-path", + "nu-pretty-hex", + "nu-protocol", + "nu-system", + "nu-table", + "nu-term-grid", + "nu-utils", + "num-format", + "num-traits", + "once_cell", + "open", + "os_pipe", + "pathdiff", + "percent-encoding", + "powierza-coefficient", + "print-positions", + "quick-xml 0.28.2", + "rand", + "rayon", + "regex", + "roxmltree", + "rust-embed", + "same-file", + "serde", + "serde_json", + "serde_urlencoded", + "serde_yaml", + "sha2", + "sysinfo", + "tabled", + "terminal_size 0.2.6", + "thiserror", + "titlecase", + "toml", + "umask", + "unicode-segmentation", + "unicode-width", + "ureq", + "url", + "users 0.11.0", + "uuid", + "wax", + "windows", + "winreg", +] + +[[package]] +name = "nu-engine" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5a63e1a390ceafa336ac4332724502a478b5dec2f67b24fd1d19fcd4d019b0" +dependencies = [ + "chrono", + "nu-glob", + "nu-path", + "nu-protocol", + "nu-utils", + "serde", + "sysinfo", +] + +[[package]] +name = "nu-explore" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e23dbc34cdcdd552cfcb18fd17e37e64f7ab23fe84e09704ccb5dc8c7fc1f25b" +dependencies = [ + "ansi-str", + "crossterm", + "lscolors", + "nu-ansi-term", + "nu-color-config", + "nu-engine", + "nu-json", + "nu-parser", + "nu-protocol", + "nu-table", + "nu-utils", + "ratatui", + "strip-ansi-escapes", + "terminal_size 0.2.6", +] + +[[package]] +name = "nu-glob" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "922b20eb03387d5aa1d41bc9dbdd47799648c5417a0632328b3e367cb035b31f" + +[[package]] +name = "nu-json" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ecfca6ab862bf02b517631be081a73042c61b23e006ae5bf5918ec075bb0958" +dependencies = [ + "linked-hash-map", + "num-traits", + "serde", +] + +[[package]] +name = "nu-parser" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b08bff634f103a958b184d7664207271a9a99ffc9a45b80709c71c1af5d2e63" +dependencies = [ + "bytesize", + "chrono", + "itertools", + "log", + "miette", + "nu-engine", + "nu-path", + "nu-protocol", + "serde_json", + "thiserror", +] + +[[package]] +name = "nu-path" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109b3cb16c1f1a134b19f63aa7d633af5f0ec61f25c5cb96e0f775c3794e9773" +dependencies = [ + "dirs-next", + "omnipath", + "pwd", +] + +[[package]] +name = "nu-pretty-hex" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6feea74d41b26454859a9491b4435bc998f49cfe67250ed87c9b1d4b0ad7ad2" +dependencies = [ + "nu-ansi-term", +] + +[[package]] +name = "nu-protocol" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7943cef88db9b614326b924125a7342e1a46e4eb9e82547becf917765f62d4" +dependencies = [ + "byte-unit", + "chrono", + "chrono-humanize", + "fancy-regex", + "indexmap", + "lru", + "miette", + "nu-utils", + "num-format", + "serde", + "serde_json", + "strum", + "strum_macros", + "sys-locale", + "thiserror", + "typetag", +] + +[[package]] +name = "nu-system" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26c774c07a7557184a94156155904ee94db00ad4f5d3eedc4259006ec96c8f44" +dependencies = [ + "atty", + "chrono", + "errno 0.3.1", + "libc", + "libproc", + "log", + "mach2", + "nix", + "ntapi", + "once_cell", + "procfs", + "winapi 0.3.9", +] + +[[package]] +name = "nu-table" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d7d500ae0eb853d031c0d7cba9d3ff9fb595c98a19333a4840e8989be5440ea" +dependencies = [ + "nu-ansi-term", + "nu-color-config", + "nu-engine", + "nu-protocol", + "nu-utils", + "tabled", +] + +[[package]] +name = "nu-term-grid" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26f1345c79d7b743d23eb9d661c0fa5cc461452c2fdd43292b4dcbc5b06e526" +dependencies = [ + "nu-utils", + "unicode-width", +] + +[[package]] +name = "nu-test-support" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a08478c5cee6fb6e107a02f6e5a8312a219f54f9914072a2582e047b39d2d453" +dependencies = [ + "getset", + "hamcrest2", + "nu-glob", + "nu-path", + "nu-utils", + "num-format", + "tempfile", + "which", +] + +[[package]] +name = "nu-utils" +version = "0.80.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da43579f039c9428df85f28fc58c4b1732ba2a7a9971c1b56dbe39b0a8e8ac3" +dependencies = [ + "crossterm_winapi", + "log", + "lscolors", + "num-format", + "strip-ansi-escapes", + "sys-locale", +] + +[[package]] +name = "num" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec 0.7.2", + "itoa", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + +[[package]] +name = "omnipath" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80adb31078122c880307e9cdfd4e3361e6545c319f9b9dcafcb03acd3b51a575" + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "open" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16814a067484415fda653868c9be0ac5f2abd2ef5d951082a5f2fe1b3662944" +dependencies = [ + "is-wsl", + "pathdiff", +] + +[[package]] +name = "openssl" +version = "0.10.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_pipe" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "papergrid" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fdfe703c51ddc52887ad78fc69cd2ea78d895ffcd6e955c9d03566db8ab5bb1" +dependencies = [ + "ansi-str", + "ansitok", + "bytecount", + "fnv", + "unicode-width", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "parse-zoneinfo" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41" +dependencies = [ + "regex", +] + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "phf" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56ac890c5e3ca598bbdeaa99964edb5b0258a583a9eb6ef4e89fc85d9224770" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_shared" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "pori" +version = "0.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a63d338dec139f56dacc692ca63ad35a6be6a797442479b55acd611d79e906" +dependencies = [ + "nom", +] + +[[package]] +name = "portable-atomic" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" +dependencies = [ + "portable-atomic 1.3.2", +] + +[[package]] +name = "portable-atomic" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc59d1bcc64fc5d021d67521f818db868368028108d37f0e98d74e33f68297b5" + +[[package]] +name = "powierza-coefficient" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04123079750026568dff0e68efe1ca676f6686023f3bf7686b87dab661c0375b" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "print-positions" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df593470e3ef502e48cb0cfc9a3a61e5f61e967b78e1ed35a67ac615cfbd208" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "procfs" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "943ca7f9f29bab5844ecd8fdb3992c5969b6622bb9609b9502fef9b4310e3f1f" +dependencies = [ + "bitflags", + "byteorder", + "chrono", + "flate2", + "hex", + "lazy_static", + "rustix 0.36.14", +] + +[[package]] +name = "pure-rust-locales" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45c49fc4f91f35bae654f85ebb3a44d60ac64f11b3166ffa609def390c732d8" + +[[package]] +name = "pwd" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c71c0c79b9701efe4e1e4b563b2016dd4ee789eb99badcb09d61ac4b92e4a2" +dependencies = [ + "libc", + "thiserror", +] + +[[package]] +name = "quick-xml" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58e21a144a0ffb5fad7b464babcdab934a325ad69b7c0373bcfef5cbd9799ca9" +dependencies = [ + "encoding_rs", + "memchr", +] + +[[package]] +name = "quick-xml" +version = "0.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "ratatui" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcc0d032bccba900ee32151ec0265667535c230169f5a011154cdcd984e16829" +dependencies = [ + "bitflags", + "cassowary", + "crossterm", + "unicode-segmentation", + "unicode-width", +] + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "reedline" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31d763be5efcabcd27d6e804d126661215aa0a2d898c13c0aa1c953c6652fcec" +dependencies = [ + "chrono", + "crossterm", + "fd-lock", + "itertools", + "nu-ansi-term", + "rusqlite", + "serde", + "serde_json", + "strip-ansi-escapes", + "strum", + "strum_macros", + "thiserror", + "unicode-segmentation", + "unicode-width", +] + +[[package]] +name = "regex" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1a59b5d8e97dee33696bf13c5ba8ab85341c002922fba050069326b9c498974" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[package]] +name = "roxmltree" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8f595a457b6b8c6cda66a48503e92ee8d19342f905948f29c383200ec9eb1d8" +dependencies = [ + "xmlparser", +] + +[[package]] +name = "rusqlite" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01e213bc3ecb39ac32e81e51ebe31fd888a940515173e3a18a35f8c6e896422a" +dependencies = [ + "bitflags", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", +] + +[[package]] +name = "rust-embed" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b68543d5527e158213414a92832d2aab11a84d2571a5eb021ebe22c43aab066" +dependencies = [ + "rust-embed-impl", + "rust-embed-utils", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "6.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d4e0f0ced47ded9a68374ac145edd65a6c1fa13a96447b873660b2a568a0fd7" +dependencies = [ + "proc-macro2", + "quote", + "rust-embed-utils", + "syn 1.0.109", + "walkdir", +] + +[[package]] +name = "rust-embed-utils" +version = "7.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512b0ab6853f7e14e3c8754acb43d6f748bb9ced66aa5915a6553ac8213f7731" +dependencies = [ + "sha2", + "walkdir", +] + +[[package]] +name = "rust_decimal" +version = "1.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26bd36b60561ee1fb5ec2817f198b6fd09fa571c897a5e86d1487cfc2b096dfc" +dependencies = [ + "arrayvec 0.7.2", + "num-traits", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.36.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14e4d67015953998ad0eb82887a0eb0129e18a7e2f3b7b0f6c422fddcd503d62" +dependencies = [ + "bitflags", + "errno 0.3.1", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags", + "errno 0.3.1", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustversion" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "security-framework" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest", +] + +[[package]] +name = "shadow-rs" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427f07ab5f873000cf55324882e12a88c0a7ea7025df4fc1e7e35e688877a583" +dependencies = [ + "const_format", + "is_debug", + "time 0.3.21", +] + +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + +[[package]] +name = "signal-hook" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" +dependencies = [ + "libc", + "mio 0.8.6", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "similar" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "smawk" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" + +[[package]] +name = "snapbox" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6bccd62078347f89a914e3004d94582e13824d4e3d8a816317862884c423835" +dependencies = [ + "anstream", + "anstyle", + "normalize-line-endings", + "similar", + "snapbox-macros", +] + +[[package]] +name = "snapbox-macros" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaaf09df9f0eeae82be96290918520214530e738a7fe5a351b0f24cf77c0ca31" +dependencies = [ + "anstream", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strip-ansi-escapes" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "011cbb39cf7c1f62871aea3cc46e5817b0937b49e9447370c93cacbe93a766d8" +dependencies = [ + "vte", +] + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "supports-color" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4950e7174bffabe99455511c39707310e7e9b440364a2fcb1cc21521be57b354" +dependencies = [ + "is-terminal", + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d" +dependencies = [ + "is-terminal", +] + +[[package]] +name = "supports-unicode" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b6c2cb240ab5dd21ed4906895ee23fe5a48acdbd15a3ce388e7b62a9b66baf7" +dependencies = [ + "is-terminal", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sys-locale" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0b9eefabb91675082b41eb94c3ecd91af7656caee3fb4961a07c0ec8c7ca6f" +dependencies = [ + "libc", + "windows-sys 0.45.0", +] + +[[package]] +name = "sysinfo" +version = "0.28.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c2f3ca6693feb29a89724516f016488e9aafc7f37264f898593ee4b942f31b" +dependencies = [ + "cfg-if 1.0.0", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "rayon", + "winapi 0.3.9", +] + +[[package]] +name = "tabled" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da1a2e56bbf7bfdd08aaa7592157a742205459eff774b73bc01809ae2d99dc2a" +dependencies = [ + "ansi-str", + "ansitok", + "papergrid", + "tabled_derive", + "unicode-width", +] + +[[package]] +name = "tabled_derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99f688a08b54f4f02f0a3c382aefdb7884d3d69609f785bd253dc033243e3fe4" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tempfile" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "redox_syscall 0.3.5", + "rustix 0.37.19", + "windows-sys 0.45.0", +] + +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "terminal_size" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" +dependencies = [ + "rustix 0.37.19", + "windows-sys 0.48.0", +] + +[[package]] +name = "textwrap" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi 0.3.9", +] [[package]] -name = "cc" -version = "1.0.78" +name = "time" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" +dependencies = [ + "itoa", + "libc", + "num_threads", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] -name = "clap" -version = "4.1.4" +name = "time-macros" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" +checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" dependencies = [ - "bitflags", - "clap_lex", + "time-core", ] [[package]] -name = "clap_complete" -version = "4.1.1" +name = "tinyvec" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6540eedc41f8a5a76cf3d8d458057dcdf817be4158a55b5f861f7a5483de75" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ - "clap", + "tinyvec_macros", ] [[package]] -name = "clap_complete_nushell" -version = "0.1.10" +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "titlecase" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38397a8cdb017cfeb48bf6c154d6de975ac69ffeed35980fde199d2ee0842042" dependencies = [ - "clap", - "clap_complete", - "snapbox", + "joinery", + "lazy_static", + "regex", ] [[package]] -name = "clap_lex" -version = "0.3.1" +name = "toml" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" dependencies = [ - "os_str_bytes", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", ] [[package]] -name = "concolor" -version = "0.0.11" +name = "toml_datetime" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "318d6c16e73b3a900eb212ad6a82fc7d298c5ab8184c7a9998646455bc474a16" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" dependencies = [ - "bitflags", - "concolor-query", - "is-terminal", + "serde", ] [[package]] -name = "concolor-query" -version = "0.1.0" +name = "toml_edit" +version = "0.19.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a90734b3d5dcf656e7624cca6bce9c3a90ee11f900e80141a7427ccfb3d317" +checksum = "92d964908cec0d030b812013af25a0e57fddfadb1e066ecc6681d86253129d4f" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] [[package]] -name = "errno" +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "typetag" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "6a6898cc6f6a32698cc3e14d5632a14d2b23ed9f7b11e6b8e05ce685990acc22" dependencies = [ - "errno-dragonfly", - "libc", - "winapi", + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "typetag-impl" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "2c3e1c30cedd24fc597f7d37a721efdbdc2b1acae012c1ef1218f4c7c2c0f3e7" dependencies = [ - "cc", - "libc", + "proc-macro2", + "quote", + "syn 2.0.16", ] [[package]] -name = "hermit-abi" -version = "0.2.6" +name = "umask" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +checksum = "ec9a46c2549e35c054e0ffe281a3a6ec0007793db4df106604d37ed3f4d73d1c" +dependencies = [ + "thiserror", +] + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-linebreak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" +dependencies = [ + "hashbrown 0.12.3", + "regex", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" + +[[package]] +name = "ureq" +version = "2.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "338b31dd1314f68f3aabf3ed57ab922df95ffcd902476ca7ba3c4ce7b908c46d" +dependencies = [ + "base64 0.13.1", + "encoding_rs", + "flate2", + "log", + "native-tls", + "once_cell", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "users" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4227e95324a443c9fcb06e03d4d85e91aabe9a5a02aa818688b6918b6af486" dependencies = [ "libc", + "log", ] [[package]] -name = "io-lifetimes" -version = "1.0.4" +name = "users" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +checksum = "24cc0f6d6f267b73e5a2cadf007ba8f9bc39c6a6f9666f8cf25ea809a153b032" dependencies = [ "libc", - "windows-sys", + "log", ] [[package]] -name = "is-terminal" -version = "0.4.2" +name = "utf8-width" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" dependencies = [ - "hermit-abi", - "io-lifetimes", - "rustix", - "windows-sys", + "getrandom", ] [[package]] -name = "libc" -version = "0.2.139" +name = "vcpkg" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] -name = "linux-raw-sys" -version = "0.1.4" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "normalize-line-endings" -version = "0.3.0" +name = "vte" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" +checksum = "6cbce692ab4ca2f1f3047fcf732430249c0e971bfdd2b234cf2c47ad93af5983" +dependencies = [ + "arrayvec 0.5.2", + "utf8parse", + "vte_generate_state_changes", +] [[package]] -name = "os_str_bytes" -version = "6.4.1" +name = "vte_generate_state_changes" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" +dependencies = [ + "proc-macro2", + "quote", +] [[package]] -name = "rustix" -version = "0.36.7" +name = "walkdir" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ - "bitflags", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys", + "same-file", + "winapi-util", ] [[package]] -name = "similar" -version = "2.2.1" +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] -name = "snapbox" -version = "0.4.4" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34eced5a65e76d5a00047986a83c65f80dc666faa27b5138f331659e2ca6bcf5" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ - "concolor", - "normalize-line-endings", - "similar", - "snapbox-macros", - "yansi", + "cfg-if 1.0.0", + "wasm-bindgen-macro", ] [[package]] -name = "snapbox-macros" -version = "0.3.1" +name = "wasm-bindgen-backend" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.16", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" + +[[package]] +name = "wax" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "485e65c1203eb37244465e857d15a26d3a85a5410648ccb53b18bd44cb3a7336" +checksum = "06c7a3bac6110ac062b7b422a442b7ee23e07209e2784a036654cab1e71bbafc" +dependencies = [ + "bstr", + "const_format", + "itertools", + "nom", + "nom-supreme", + "pori", + "regex", + "smallvec", + "thiserror", + "walkdir", +] + +[[package]] +name = "which" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +dependencies = [ + "either", + "libc", + "once_cell", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" @@ -193,77 +3500,232 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.0", +] + [[package]] name = "windows-sys" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winnow" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if 1.0.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "xmlparser" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd" [[package]] -name = "yansi" -version = "0.5.1" +name = "zip" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", +] diff --git a/Cargo.toml b/Cargo.toml index 8d2e2eb60a2..453424a388f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,3 +28,9 @@ clap_complete = "4.0" [dev-dependencies] snapbox = { version = "0.4", features = ["diff"] } +nu-cli = "0.80.0" +nu-command = "0.80.0" +nu-parser = "0.80.0" +nu-protocol = "0.80.0" +nu-test-support = "0.80.0" +reedline = "0.19.1" diff --git a/tests/completion.rs b/tests/completion.rs new file mode 100644 index 00000000000..d9eaa6dc713 --- /dev/null +++ b/tests/completion.rs @@ -0,0 +1,312 @@ +use std::fs::File; +use std::io::Read; +use std::path::PathBuf; +use std::sync::Arc; + +use nu_cli::NuCompleter; +use nu_command::create_default_context; +use nu_parser::parse; +use nu_protocol::{ + engine::{EngineState, Stack, StateWorkingSet}, + Value, +}; +use nu_test_support::fs; + +use reedline::{Completer, Suggestion}; + +const SEP: char = std::path::MAIN_SEPARATOR; + +// creates a new engine with the current path into the completions fixtures folder +pub fn new_engine() -> (PathBuf, EngineState, Stack) { + // Target folder inside assets + let mut dir = fs::root().join("tests"); + dir.push("snapshots"); + + let mut dir_str = dir + .clone() + .into_os_string() + .into_string() + .unwrap_or_default(); + dir_str.push(SEP); + + // Create a new engine with default context + let mut engine_state = create_default_context(); + + // New stack + let mut stack = Stack::new(); + + // Add pwd as env var + stack.add_env_var( + "PWD".to_string(), + Value::String { + val: dir_str.clone(), + span: nu_protocol::Span::new(0, dir_str.len()), + }, + ); + + #[cfg(windows)] + stack.add_env_var( + "Path".to_string(), + Value::String { + val: "c:\\some\\path;c:\\some\\other\\path".to_string(), + span: nu_protocol::Span::new(0, dir_str.len()), + }, + ); + + #[cfg(not(windows))] + stack.add_env_var( + "PATH".to_string(), + Value::String { + val: "/some/path:/some/other/path".to_string(), + span: nu_protocol::Span::new(0, dir_str.len()), + }, + ); + + // Merge environment into the permanent state + let merge_result = engine_state.merge_env(&mut stack, &dir); + assert!(merge_result.is_ok()); + + (dir, engine_state, stack) +} + +// match a list of suggestions with the expected values +pub fn match_suggestions(expected: Vec, suggestions: Vec) { + let expected_len = expected.len(); + let suggestions_len = suggestions.len(); + if expected_len != suggestions_len { + panic!( + "\nexpected {expected_len} suggestions but got {suggestions_len}: \n\ + Suggestions: {suggestions:#?} \n\ + Expected: {expected:#?}\n" + ) + } + expected.iter().zip(suggestions).for_each(|it| { + assert_eq!(it.0, &it.1.value); + }); +} + +fn external_completion(file_name: &str) -> NuCompleter { + // Create a new engine + let (dir, mut engine_state, mut stack) = new_engine(); + + let path = dir.join(file_name); + let mut buf = Vec::new(); + let mut file = + File::open(&path).unwrap_or_else(|_| panic!("Failed to open {}", path.display())); + file.read_to_end(&mut buf) + .unwrap_or_else(|_| panic!("Failed to open {}", path.display())); + + let (_, delta) = { + let mut working_set = StateWorkingSet::new(&engine_state); + let block = parse(&mut working_set, None, &buf, false); + assert!(working_set.parse_errors.is_empty()); + + (block, working_set.render()) + }; + + assert!(engine_state.merge_delta(delta).is_ok()); + + // Merge environment into the permanent state + assert!(engine_state.merge_env(&mut stack, &dir).is_ok()); + + let latest_block_id = engine_state.num_blocks() - 1; + + // Change config adding the external completer + let mut config = engine_state.get_config().clone(); + config.external_completer = Some(latest_block_id); + engine_state.set_config(&config); + + // Instantiate a new completer + NuCompleter::new(Arc::new(engine_state), stack) +} + +#[test] +fn completion_basic() { + let mut completer = external_completion("basic.nu"); + + let input = "my-app -"; + let suggestions = completer.complete(input, input.len()); + let expected = vec!["-c".into(), "-v".into()]; + match_suggestions(expected, suggestions); + + let input = "my-app test -"; + let suggestions = completer.complete(input, input.len()); + let expected = vec!["-c".into(), "-d".into()]; + match_suggestions(expected, suggestions); +} + +#[test] +fn completion_feature_sample() { + let mut completer = external_completion("feature_sample.nu"); + + let input = "my-app test --"; + let suggestions = completer.complete(input, input.len()); + let expected = vec!["--case".into(), "--version".into()]; + match_suggestions(expected, suggestions); + + let input = "my-app choice "; + let suggestions = completer.complete(input, input.len()); + let expected = vec!["first".into(), "second".into()]; + match_suggestions(expected, suggestions); + + let input = "my-app -"; + let suggestions = completer.complete(input, input.len()); + let expected = vec![ + "--conf".into(), + "--config".into(), + "--version".into(), + "-C".into(), + "-V".into(), + "-c".into(), + ]; + match_suggestions(expected, suggestions); + + let input = "my-app --"; + let suggestions = completer.complete(input, input.len()); + let expected = vec!["--conf".into(), "--config".into(), "--version".into()]; + match_suggestions(expected, suggestions); +} + +#[test] +fn completion_special_commands() { + let mut completer = external_completion("special_commands.nu"); + + let input = "my-app some"; + let suggestions = completer.complete(input, input.len()); + let expected = vec![ + "my-app some_cmd".into(), + "my-app some-hidden-cmd".into(), + "my-app some-cmd-with-hyphens".into(), + ]; + match_suggestions(expected, suggestions); + + let input = "my-app choice "; + let suggestions = completer.complete(input, input.len()); + let expected = vec!["first".into(), "second".into()]; + match_suggestions(expected, suggestions); + + let input = "my-app -"; + let suggestions = completer.complete(input, input.len()); + let expected = vec![ + "--conf".into(), + "--config".into(), + "--version".into(), + "-C".into(), + "-V".into(), + "-c".into(), + ]; + match_suggestions(expected, suggestions); + + let input = "my-app --"; + let suggestions = completer.complete(input, input.len()); + let expected = vec!["--conf".into(), "--config".into(), "--version".into()]; + match_suggestions(expected, suggestions); +} + +#[test] +fn completion_quoting() { + let mut completer = external_completion("quoting.nu"); + + let input = "my-app cmd-s"; + let suggestions = completer.complete(input, input.len()); + let expected = vec!["my-app cmd-single-quotes".into()]; + match_suggestions(expected, suggestions); + + let input = "my-app --"; + let suggestions = completer.complete(input, input.len()); + let expected = vec![ + "--backslash".into(), + "--backticks".into(), + "--brackets".into(), + "--double-quotes".into(), + "--expansions".into(), + "--single-quotes".into(), + "--version".into(), + ]; + match_suggestions(expected, suggestions); +} + +#[test] +fn completion_aliases() { + let mut completer = external_completion("aliases.nu"); + + let input = "my-app -"; + let suggestions = completer.complete(input, input.len()); + let expected = vec![ + "--flag".into(), + "--flg".into(), + "--opt".into(), + "--option".into(), + "--version".into(), + "-F".into(), + "-O".into(), + "-V".into(), + "-f".into(), + "-o".into(), + ]; + match_suggestions(expected, suggestions); +} + +#[test] +fn completion_sub_subcommands() { + let mut completer = external_completion("sub_subcommands.nu"); + + let input = "my-app"; + let suggestions = completer.complete(input, input.len()); + let expected = vec![ + "my-app".into(), + "my-app test".into(), + "my-app some_cmd".into(), + "my-app some_cmd sub_cmd".into(), + ]; + match_suggestions(expected, suggestions); + + let input = "my-app some_cmd sub_cmd -"; + let suggestions = completer.complete(input, input.len()); + let expected = vec!["--config".into(), "--version".into(), "-V".into()]; + match_suggestions(expected, suggestions); + + let input = "my-app some_cmd sub_cmd --config "; + let suggestions = completer.complete(input, input.len()); + let expected = vec![ + "\"Lest quotes, aren't escaped.\"".into(), + "\"Second to trigger display of options\"".into(), + ]; + match_suggestions(expected, suggestions); +} + +#[test] +fn completion_value_hint() { + let mut completer = external_completion("value_hint.nu"); + + let input = "my-app -"; + let suggestions = completer.complete(input, input.len()); + let expected = vec![ + "--choice".into(), + "--cmd".into(), + "--cmd-name".into(), + "--dir".into(), + "--email".into(), + "--exe".into(), + "--file".into(), + "--host".into(), + "--other".into(), + "--path".into(), + "--unknown".into(), + "--url".into(), + "--user".into(), + "-H".into(), + "-c".into(), + "-d".into(), + "-e".into(), + "-f".into(), + "-p".into(), + "-u".into(), + ]; + match_suggestions(expected, suggestions); + + let input = "my-app --choice "; + let suggestions = completer.complete(input, input.len()); + let expected = vec!["bash".into(), "fish".into(), "zsh".into()]; + match_suggestions(expected, suggestions); +} From 7e6eb7d280178959177a2452188cc4a27dfc5302 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 23 May 2023 13:21:43 +0800 Subject: [PATCH 40/42] chore: prepare for upstreaming --- Cargo.toml | 2 +- LICENSE-APACHE | 201 +++++++++++++++++++++++++++++++++++++++++ LICENSE => LICENSE-MIT | 0 README.md | 3 +- scripts/gen_readme.nu | 3 +- 5 files changed, 206 insertions(+), 3 deletions(-) create mode 100644 LICENSE-APACHE rename LICENSE => LICENSE-MIT (100%) diff --git a/Cargo.toml b/Cargo.toml index 453424a388f..9190d8ac44b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "clap_complete_nushell" authors = [ "nibon7 " ] version = "0.1.10" edition = "2021" -license = "MIT" +license = "MIT OR Apache-2.0" description = "A generator library used with clap for Nushell completion scripts" homepage = "https://github.com/nibon7/clap_complete_nushell" repository = "https://github.com/nibon7/clap_complete_nushell" diff --git a/LICENSE-APACHE b/LICENSE-APACHE new file mode 100644 index 00000000000..261eeb9e9f8 --- /dev/null +++ b/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/LICENSE b/LICENSE-MIT similarity index 100% rename from LICENSE rename to LICENSE-MIT diff --git a/README.md b/README.md index 7852cda6425..efe1695ad5d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ Generates [Nushell](https://github.com/nushell/nushell) completions for [`clap`] [![Crates.io](https://img.shields.io/crates/v/clap_complete_nushell)](https://crates.io/crates/clap_complete_nushell) [![Crates.io](https://img.shields.io/crates/d/clap_complete_nushell)](https://crates.io/crates/clap_complete_nushell) -[![License](https://img.shields.io/github/license/nibon7/clap_complete_nushell)](LICENSE) +[![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE-APACHE) +[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE-MIT) [![docs.rs](https://img.shields.io/docsrs/clap_complete_nushell)](https://docs.rs/clap_complete_nushell) [![Build Status](https://img.shields.io/github/actions/workflow/status/nibon7/clap_complete_nushell/ci.yml)](https://github.com/nibon7/clap_complete_nushell/actions/workflows/ci.yml?query=branch%3Amain) [![GitHub last commit](https://img.shields.io/github/last-commit/nibon7/clap_complete_nushell)](https://github.com/nibon7/clap_complete_nushell/commits/main) diff --git a/scripts/gen_readme.nu b/scripts/gen_readme.nu index d4e7bf138e0..2871f067f69 100755 --- a/scripts/gen_readme.nu +++ b/scripts/gen_readme.nu @@ -19,7 +19,8 @@ def generate_preamble [user: string, repo: string] { Generates [Nushell]\((generate_url $github nushell/nushell)\) completions for [`clap`]\((generate_url $github clap-rs/clap)\) based CLIs\n [![Crates.io]\((generate_url $baseurl crates/v $repo)\)]\((generate_url $crates crates $repo)\) [![Crates.io]\((generate_url $baseurl crates/d $repo)\)]\((generate_url $crates crates $repo)\) -[![License]\((generate_url $baseurl github/license $user)/(generate_url $repo)\)]\(LICENSE\) +[![License]\(https://img.shields.io/badge/license-Apache%202.0-blue\)]\(LICENSE-APACHE\) +[![License]\(https://img.shields.io/badge/license-MIT-blue\)]\(LICENSE-MIT\) [![docs.rs]\((generate_url $baseurl docsrs $repo)\)]\((generate_url $docs $repo)\) [![Build Status]\((generate_url $baseurl github/actions/workflow/status $user $repo ci.yml)\)]\((generate_url $github $user $repo actions/workflows/ci.yml?query=branch%3A($branch))\) [![GitHub last commit]\((generate_url $baseurl github/last-commit $user $repo)\)]\((generate_url $github $user $repo commits/($branch))\)\n\n" From 865a1c531f762ee3bb9995375d51e8241e07e6d4 Mon Sep 17 00:00:00 2001 From: nibon7 Date: Tue, 23 May 2023 13:22:59 +0800 Subject: [PATCH 41/42] chore: release 0.1.11 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43ffeb36f46..235067c9f57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -414,7 +414,7 @@ dependencies = [ [[package]] name = "clap_complete_nushell" -version = "0.1.10" +version = "0.1.11" dependencies = [ "clap", "clap_complete", diff --git a/Cargo.toml b/Cargo.toml index 9190d8ac44b..dda808130db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clap_complete_nushell" authors = [ "nibon7 " ] -version = "0.1.10" +version = "0.1.11" edition = "2021" license = "MIT OR Apache-2.0" description = "A generator library used with clap for Nushell completion scripts" From bd163098e122bb65e053a61b773931c8f36d2e7d Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 23 May 2023 08:48:39 -0500 Subject: [PATCH 42/42] refactor(nu): Prep for merge --- .github/workflows/ci.yml | 51 - .gitignore | 1 - Cargo.lock | 3731 ----------------- .../Cargo.toml | 0 .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 README.md => clap_complete_nushell/README.md | 0 .../examples}/nushell_completion.rs | 0 .../examples}/sub_subcommands.rs | 0 {src => clap_complete_nushell/src}/lib.rs | 0 .../tests}/common.rs | 0 .../tests}/completion.rs | 0 .../tests}/nushell.rs | 0 .../tests}/snapshots/aliases.nu | 0 .../tests}/snapshots/basic.nu | 0 .../tests}/snapshots/feature_sample.nu | 0 .../tests}/snapshots/quoting.nu | 0 .../tests}/snapshots/special_commands.nu | 0 .../tests}/snapshots/sub_subcommands.nu | 0 .../tests}/snapshots/value_hint.nu | 0 scripts/gen_readme.nu | 52 - 21 files changed, 3835 deletions(-) delete mode 100644 .github/workflows/ci.yml delete mode 100644 .gitignore delete mode 100644 Cargo.lock rename Cargo.toml => clap_complete_nushell/Cargo.toml (100%) rename LICENSE-APACHE => clap_complete_nushell/LICENSE-APACHE (100%) rename LICENSE-MIT => clap_complete_nushell/LICENSE-MIT (100%) rename README.md => clap_complete_nushell/README.md (100%) rename {examples => clap_complete_nushell/examples}/nushell_completion.rs (100%) rename {examples => clap_complete_nushell/examples}/sub_subcommands.rs (100%) rename {src => clap_complete_nushell/src}/lib.rs (100%) rename {tests => clap_complete_nushell/tests}/common.rs (100%) rename {tests => clap_complete_nushell/tests}/completion.rs (100%) rename {tests => clap_complete_nushell/tests}/nushell.rs (100%) rename {tests => clap_complete_nushell/tests}/snapshots/aliases.nu (100%) rename {tests => clap_complete_nushell/tests}/snapshots/basic.nu (100%) rename {tests => clap_complete_nushell/tests}/snapshots/feature_sample.nu (100%) rename {tests => clap_complete_nushell/tests}/snapshots/quoting.nu (100%) rename {tests => clap_complete_nushell/tests}/snapshots/special_commands.nu (100%) rename {tests => clap_complete_nushell/tests}/snapshots/sub_subcommands.nu (100%) rename {tests => clap_complete_nushell/tests}/snapshots/value_hint.nu (100%) delete mode 100755 scripts/gen_readme.nu diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 27148093e45..00000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: CI -on: - push: - pull_request: - schedule: - - cron: '00 04 * * *' - -env: - CARGO_TERM_COLOR: always - -jobs: - lints: - name: Lints - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - steps: - - uses: actions/checkout@v2 - - - name: Install latest stable - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - override: true - - - name: Rustfmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - - name: Check - uses: actions-rs/cargo@v1 - with: - command: check - args: --workspace --all-targets --examples --tests - - - name: Clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --workspace --all-targets --examples --tests -- -D warnings - - - name: Test - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace --all-targets --all-features diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ea8c4bf7f35..00000000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 235067c9f57..00000000000 --- a/Cargo.lock +++ /dev/null @@ -1,3731 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" -dependencies = [ - "memchr", -] - -[[package]] -name = "alphanumeric-sort" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81149050d254e2b758c80dcf55949e5c45482e0c9cb3670b1c4b48eb51791f8e" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "ansi-str" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b1ed1c166829a0ccb5d79caa0f75cb4abd4adb2ce2c096755b7ad5ffdb0990" -dependencies = [ - "ansitok", -] - -[[package]] -name = "ansitok" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220044e6a1bb31ddee4e3db724d29767f352de47445a6cd75e1a173142136c83" -dependencies = [ - "nom", - "vte", -] - -[[package]] -name = "anstream" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is-terminal", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" - -[[package]] -name = "anstyle-parse" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" -dependencies = [ - "windows-sys 0.48.0", -] - -[[package]] -name = "anstyle-wincon" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" -dependencies = [ - "anstyle", - "windows-sys 0.48.0", -] - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1e31e207a6b8fb791a38ea3105e6cb541f55e4d029902d3039a4ad07cc4105" - -[[package]] -name = "bindgen" -version = "0.59.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", -] - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "brownstone" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5839ee4f953e811bfdcf223f509cb2c6a3e1447959b0bff459405575bc17f22" -dependencies = [ - "arrayvec 0.7.2", -] - -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata", -] - -[[package]] -name = "bumpalo" -version = "3.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" - -[[package]] -name = "byte-unit" -version = "4.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da78b32057b8fdfc352504708feeba7216dcd65a2c9ab02978cbd288d1279b6c" -dependencies = [ - "serde", - "utf8-width", -] - -[[package]] -name = "bytecount" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytesize" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" - -[[package]] -name = "calamine" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6381d1037ee9b8a6c8eb97936add0331a1aabd148d5b6f35f1cda6e5dec44f40" -dependencies = [ - "byteorder", - "codepage", - "encoding_rs", - "log", - "quick-xml 0.25.0", - "serde", - "zip", -] - -[[package]] -name = "cassowary" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" - -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" -dependencies = [ - "iana-time-zone", - "js-sys", - "num-integer", - "num-traits", - "pure-rust-locales", - "serde", - "time 0.1.45", - "wasm-bindgen", - "winapi 0.3.9", -] - -[[package]] -name = "chrono-humanize" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32dce1ea1988dbdf9f9815ff11425828523bd2a134ec0805d2ac8af26ee6096e" -dependencies = [ - "chrono", -] - -[[package]] -name = "chrono-tz" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9cc2b23599e6d7479755f3594285efb3f74a1bdca7a7374948bc831e23a552" -dependencies = [ - "chrono", - "chrono-tz-build", - "phf", -] - -[[package]] -name = "chrono-tz-build" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9998fb9f7e9b2111641485bf8beb32f92945f97f92a3d061f744cfef335f751" -dependencies = [ - "parse-zoneinfo", - "phf", - "phf_codegen", -] - -[[package]] -name = "clang-sys" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "clap" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" -dependencies = [ - "anstyle", - "bitflags", - "clap_lex", -] - -[[package]] -name = "clap_complete" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a04ddfaacc3bc9e6ea67d024575fafc2a813027cf374b8f24f7bc233c6b6be12" -dependencies = [ - "clap", -] - -[[package]] -name = "clap_complete_nushell" -version = "0.1.11" -dependencies = [ - "clap", - "clap_complete", - "nu-cli", - "nu-command", - "nu-parser", - "nu-protocol", - "nu-test-support", - "reedline", - "snapbox", -] - -[[package]] -name = "clap_lex" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" - -[[package]] -name = "codepage" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b0e9222c0cdf2c6ac27d73f664f9520266fa911c3106329d359f8861cb8bde9" -dependencies = [ - "encoding_rs", -] - -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - -[[package]] -name = "console" -version = "0.15.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "unicode-width", - "windows-sys 0.45.0", -] - -[[package]] -name = "const_format" -version = "0.2.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7309d9b4d3d2c0641e018d449232f2e28f1b22933c137f157d3dbc14228b8c0e" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f47bf7270cf70d370f8f98c1abb6d2d4cf60a6845d30e05bfb90c6568650" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - -[[package]] -name = "cpufeatures" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" -dependencies = [ - "autocfg", - "cfg-if 1.0.0", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossterm" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13" -dependencies = [ - "bitflags", - "crossterm_winapi", - "libc", - "mio 0.8.6", - "parking_lot", - "serde", - "signal-hook", - "signal-hook-mio", - "winapi 0.3.9", -] - -[[package]] -name = "crossterm_winapi" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "csv" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad" -dependencies = [ - "csv-core", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" -dependencies = [ - "memchr", -] - -[[package]] -name = "dialoguer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" -dependencies = [ - "console", - "fuzzy-matcher", - "shell-words", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi 0.3.9", -] - -[[package]] -name = "dtparse" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd3b6a23c50eb90a80bdb748042620328617e76276b99dc5c97906e47f807c3" -dependencies = [ - "chrono", - "lazy_static", - "num-traits", - "rust_decimal", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "encoding_rs" -version = "0.8.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "erased-serde" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2b0c2380453a92ea8b6c8e5f64ecaafccddde8ceab55ff7a8ac1029f894569" -dependencies = [ - "serde", -] - -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - -[[package]] -name = "fallible-streaming-iterator" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" - -[[package]] -name = "fancy-regex" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" -dependencies = [ - "bit-set", - "regex", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fd-lock" -version = "3.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ae6b3d9530211fb3b12a95374b8b0823be812f53d09e18c5675c0146b09642" -dependencies = [ - "cfg-if 1.0.0", - "rustix 0.37.19", - "windows-sys 0.48.0", -] - -[[package]] -name = "filesize" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12d741e2415d4e2e5bd1c1d00409d1a8865a57892c2d689b504365655d237d43" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "filetime" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall 0.2.16", - "windows-sys 0.48.0", -] - -[[package]] -name = "flate2" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - -[[package]] -name = "fsevent" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" -dependencies = [ - "bitflags", - "fsevent-sys", -] - -[[package]] -name = "fsevent-sys" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" -dependencies = [ - "libc", -] - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - -[[package]] -name = "fuzzy-matcher" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54614a3312934d066701a80f20f15fa3b56d67ac7722b39eea5b4c9dd1d66c94" -dependencies = [ - "thread_local", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getset" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ghost" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e77ac7b51b8e6313251737fcef4b1c01a2ea102bde68415b62c0ee9268fec357" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.16", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "hamcrest2" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f837c62de05dc9cc71ff6486cd85de8856a330395ae338a04bfcefe5e91075" -dependencies = [ - "num", - "regex", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.3", -] - -[[package]] -name = "hashlink" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0761a1b9491c4f2e3d66aa0f62d0fba0af9a0e2852e4d48ea506632a4b56e6aa" -dependencies = [ - "hashbrown 0.13.2", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "htmlescape" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" - -[[package]] -name = "iana-time-zone" -version = "0.1.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indent_write" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indicatif" -version = "0.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" -dependencies = [ - "console", - "number_prefix", - "portable-atomic 0.3.20", - "unicode-width", -] - -[[package]] -name = "inotify" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" -dependencies = [ - "bitflags", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" -dependencies = [ - "libc", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "inventory" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0539b5de9241582ce6bd6b0ba7399313560151e58c9aaf8b74b711b1bdce644" -dependencies = [ - "ghost", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - -[[package]] -name = "is-docker" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" -dependencies = [ - "once_cell", -] - -[[package]] -name = "is-root" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04a4202a60e86f1c9702706bb42270dadd333f2db7810157563c86f17af3c873" -dependencies = [ - "users 0.10.0", - "winapi 0.3.9", -] - -[[package]] -name = "is-terminal" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" -dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix 0.37.19", - "windows-sys 0.48.0", -] - -[[package]] -name = "is-wsl" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" -dependencies = [ - "is-docker", - "once_cell", -] - -[[package]] -name = "is_ci" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" - -[[package]] -name = "is_debug" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06d198e9919d9822d5f7083ba8530e04de87841eaf21ead9af8f2304efd57c89" - -[[package]] -name = "is_executable" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9acdc6d67b75e626ad644734e8bc6df893d9cd2a834129065d3dd6158ea9c8" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" - -[[package]] -name = "joinery" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" - -[[package]] -name = "js-sys" -version = "0.3.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "libc" -version = "0.2.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" - -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if 1.0.0", - "winapi 0.3.9", -] - -[[package]] -name = "libproc" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b799ad155d75ce914c467ee5627b62247c20d4aedbd446f821484cebf3cded7" -dependencies = [ - "bindgen", - "errno 0.2.8", - "libc", -] - -[[package]] -name = "libsqlite3-sys" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f835d03d717946d28b1d1ed632eb6f0e24a299388ee623d0c23118d3e8a7fa" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -dependencies = [ - "serde", -] - -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "lock_api" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "lru" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03f1160296536f10c833a82dca22267d5486734230d47bf00bf435885814ba1e" -dependencies = [ - "hashbrown 0.13.2", -] - -[[package]] -name = "lscolors" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a9df1d1fb6d9e92fa043e9eb9a3ecf6892c7b542bae5137cd1e419e40aa8bf" -dependencies = [ - "nu-ansi-term", -] - -[[package]] -name = "mach2" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" -dependencies = [ - "libc", -] - -[[package]] -name = "md-5" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" -dependencies = [ - "digest", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] - -[[package]] -name = "miette" -version = "5.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a236ff270093b0b67451bc50a509bd1bad302cb1d3c7d37d5efe931238581fa9" -dependencies = [ - "is-terminal", - "miette-derive", - "once_cell", - "owo-colors", - "supports-color", - "supports-hyperlinks", - "supports-unicode", - "terminal_size 0.1.17", - "textwrap", - "thiserror", - "unicode-width", -] - -[[package]] -name = "miette-derive" -version = "5.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4901771e1d44ddb37964565c654a3223ba41a594d02b8da471cc4464912b5cfa" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.16", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" -dependencies = [ - "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio 0.6.23", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "net2" -version = "0.2.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "nix" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "libc", - "static_assertions", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nom-supreme" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd3ae6c901f1959588759ff51c95d24b491ecb9ff91aa9c2ef4acc5b1dcab27" -dependencies = [ - "brownstone", - "indent_write", - "joinery", - "memchr", - "nom", -] - -[[package]] -name = "normalize-line-endings" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" - -[[package]] -name = "notify" -version = "4.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257" -dependencies = [ - "bitflags", - "filetime", - "fsevent", - "fsevent-sys", - "inotify", - "libc", - "mio 0.6.23", - "mio-extras", - "walkdir", - "winapi 0.3.9", -] - -[[package]] -name = "ntapi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "nu-ansi-term" -version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df031e117bca634c262e9bd3173776844b6c17a90b3741c9163663b4385af76" -dependencies = [ - "windows-sys 0.45.0", -] - -[[package]] -name = "nu-cli" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "026a72e68144fc24d6a290d8c7a1601c4aeee3ac04ab9599179776847a3dd13e" -dependencies = [ - "atty", - "chrono", - "crossterm", - "fancy-regex", - "fuzzy-matcher", - "is_executable", - "log", - "miette", - "nu-ansi-term", - "nu-color-config", - "nu-command", - "nu-engine", - "nu-parser", - "nu-path", - "nu-protocol", - "nu-utils", - "once_cell", - "percent-encoding", - "reedline", - "sysinfo", - "thiserror", - "unicode-segmentation", -] - -[[package]] -name = "nu-cmd-lang" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aa3cacbe9407dea1fbb13b5cc84c240d5e76af0e62f97f754de95c663234e61" -dependencies = [ - "fancy-regex", - "itertools", - "log", - "nu-ansi-term", - "nu-color-config", - "nu-engine", - "nu-parser", - "nu-protocol", - "nu-utils", - "shadow-rs", -] - -[[package]] -name = "nu-color-config" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed4196a9f7414cbd61ddbc9f1edf1b1d053fb749652e4bead7290bc35d2db481" -dependencies = [ - "nu-ansi-term", - "nu-engine", - "nu-json", - "nu-protocol", - "nu-utils", - "serde", -] - -[[package]] -name = "nu-command" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba922c35e40f3fd436fa1daff8ef7fe1f23a13f0106d038f40d8e421abea08ce" -dependencies = [ - "Inflector", - "alphanumeric-sort", - "atty", - "base64 0.21.1", - "byteorder", - "bytesize", - "calamine", - "chrono", - "chrono-humanize", - "chrono-tz", - "crossterm", - "csv", - "dialoguer", - "digest", - "dtparse", - "encoding_rs", - "fancy-regex", - "filesize", - "filetime", - "fs_extra", - "htmlescape", - "indexmap", - "indicatif", - "is-root", - "itertools", - "libc", - "log", - "lscolors", - "md-5", - "miette", - "mime", - "mime_guess", - "native-tls", - "notify", - "nu-ansi-term", - "nu-cmd-lang", - "nu-color-config", - "nu-engine", - "nu-explore", - "nu-glob", - "nu-json", - "nu-parser", - "nu-path", - "nu-pretty-hex", - "nu-protocol", - "nu-system", - "nu-table", - "nu-term-grid", - "nu-utils", - "num-format", - "num-traits", - "once_cell", - "open", - "os_pipe", - "pathdiff", - "percent-encoding", - "powierza-coefficient", - "print-positions", - "quick-xml 0.28.2", - "rand", - "rayon", - "regex", - "roxmltree", - "rust-embed", - "same-file", - "serde", - "serde_json", - "serde_urlencoded", - "serde_yaml", - "sha2", - "sysinfo", - "tabled", - "terminal_size 0.2.6", - "thiserror", - "titlecase", - "toml", - "umask", - "unicode-segmentation", - "unicode-width", - "ureq", - "url", - "users 0.11.0", - "uuid", - "wax", - "windows", - "winreg", -] - -[[package]] -name = "nu-engine" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5a63e1a390ceafa336ac4332724502a478b5dec2f67b24fd1d19fcd4d019b0" -dependencies = [ - "chrono", - "nu-glob", - "nu-path", - "nu-protocol", - "nu-utils", - "serde", - "sysinfo", -] - -[[package]] -name = "nu-explore" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e23dbc34cdcdd552cfcb18fd17e37e64f7ab23fe84e09704ccb5dc8c7fc1f25b" -dependencies = [ - "ansi-str", - "crossterm", - "lscolors", - "nu-ansi-term", - "nu-color-config", - "nu-engine", - "nu-json", - "nu-parser", - "nu-protocol", - "nu-table", - "nu-utils", - "ratatui", - "strip-ansi-escapes", - "terminal_size 0.2.6", -] - -[[package]] -name = "nu-glob" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "922b20eb03387d5aa1d41bc9dbdd47799648c5417a0632328b3e367cb035b31f" - -[[package]] -name = "nu-json" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ecfca6ab862bf02b517631be081a73042c61b23e006ae5bf5918ec075bb0958" -dependencies = [ - "linked-hash-map", - "num-traits", - "serde", -] - -[[package]] -name = "nu-parser" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b08bff634f103a958b184d7664207271a9a99ffc9a45b80709c71c1af5d2e63" -dependencies = [ - "bytesize", - "chrono", - "itertools", - "log", - "miette", - "nu-engine", - "nu-path", - "nu-protocol", - "serde_json", - "thiserror", -] - -[[package]] -name = "nu-path" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109b3cb16c1f1a134b19f63aa7d633af5f0ec61f25c5cb96e0f775c3794e9773" -dependencies = [ - "dirs-next", - "omnipath", - "pwd", -] - -[[package]] -name = "nu-pretty-hex" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6feea74d41b26454859a9491b4435bc998f49cfe67250ed87c9b1d4b0ad7ad2" -dependencies = [ - "nu-ansi-term", -] - -[[package]] -name = "nu-protocol" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7943cef88db9b614326b924125a7342e1a46e4eb9e82547becf917765f62d4" -dependencies = [ - "byte-unit", - "chrono", - "chrono-humanize", - "fancy-regex", - "indexmap", - "lru", - "miette", - "nu-utils", - "num-format", - "serde", - "serde_json", - "strum", - "strum_macros", - "sys-locale", - "thiserror", - "typetag", -] - -[[package]] -name = "nu-system" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c774c07a7557184a94156155904ee94db00ad4f5d3eedc4259006ec96c8f44" -dependencies = [ - "atty", - "chrono", - "errno 0.3.1", - "libc", - "libproc", - "log", - "mach2", - "nix", - "ntapi", - "once_cell", - "procfs", - "winapi 0.3.9", -] - -[[package]] -name = "nu-table" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d7d500ae0eb853d031c0d7cba9d3ff9fb595c98a19333a4840e8989be5440ea" -dependencies = [ - "nu-ansi-term", - "nu-color-config", - "nu-engine", - "nu-protocol", - "nu-utils", - "tabled", -] - -[[package]] -name = "nu-term-grid" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26f1345c79d7b743d23eb9d661c0fa5cc461452c2fdd43292b4dcbc5b06e526" -dependencies = [ - "nu-utils", - "unicode-width", -] - -[[package]] -name = "nu-test-support" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08478c5cee6fb6e107a02f6e5a8312a219f54f9914072a2582e047b39d2d453" -dependencies = [ - "getset", - "hamcrest2", - "nu-glob", - "nu-path", - "nu-utils", - "num-format", - "tempfile", - "which", -] - -[[package]] -name = "nu-utils" -version = "0.80.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da43579f039c9428df85f28fc58c4b1732ba2a7a9971c1b56dbe39b0a8e8ac3" -dependencies = [ - "crossterm_winapi", - "log", - "lscolors", - "num-format", - "strip-ansi-escapes", - "sys-locale", -] - -[[package]] -name = "num" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-format" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" -dependencies = [ - "arrayvec 0.7.2", - "itoa", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" -dependencies = [ - "hermit-abi 0.2.6", - "libc", -] - -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - -[[package]] -name = "omnipath" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80adb31078122c880307e9cdfd4e3361e6545c319f9b9dcafcb03acd3b51a575" - -[[package]] -name = "once_cell" -version = "1.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" - -[[package]] -name = "open" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16814a067484415fda653868c9be0ac5f2abd2ef5d951082a5f2fe1b3662944" -dependencies = [ - "is-wsl", - "pathdiff", -] - -[[package]] -name = "openssl" -version = "0.10.52" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.16", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "os_pipe" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "owo-colors" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" - -[[package]] -name = "papergrid" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fdfe703c51ddc52887ad78fc69cd2ea78d895ffcd6e955c9d03566db8ab5bb1" -dependencies = [ - "ansi-str", - "ansitok", - "bytecount", - "fnv", - "unicode-width", -] - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "windows-sys 0.45.0", -] - -[[package]] -name = "parse-zoneinfo" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41" -dependencies = [ - "regex", -] - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "percent-encoding" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" - -[[package]] -name = "phf" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_codegen" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56ac890c5e3ca598bbdeaa99964edb5b0258a583a9eb6ef4e89fc85d9224770" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" -dependencies = [ - "phf_shared", - "rand", -] - -[[package]] -name = "phf_shared" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "pori" -version = "0.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a63d338dec139f56dacc692ca63ad35a6be6a797442479b55acd611d79e906" -dependencies = [ - "nom", -] - -[[package]] -name = "portable-atomic" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" -dependencies = [ - "portable-atomic 1.3.2", -] - -[[package]] -name = "portable-atomic" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc59d1bcc64fc5d021d67521f818db868368028108d37f0e98d74e33f68297b5" - -[[package]] -name = "powierza-coefficient" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04123079750026568dff0e68efe1ca676f6686023f3bf7686b87dab661c0375b" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "print-positions" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df593470e3ef502e48cb0cfc9a3a61e5f61e967b78e1ed35a67ac615cfbd208" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "procfs" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943ca7f9f29bab5844ecd8fdb3992c5969b6622bb9609b9502fef9b4310e3f1f" -dependencies = [ - "bitflags", - "byteorder", - "chrono", - "flate2", - "hex", - "lazy_static", - "rustix 0.36.14", -] - -[[package]] -name = "pure-rust-locales" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45c49fc4f91f35bae654f85ebb3a44d60ac64f11b3166ffa609def390c732d8" - -[[package]] -name = "pwd" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c71c0c79b9701efe4e1e4b563b2016dd4ee789eb99badcb09d61ac4b92e4a2" -dependencies = [ - "libc", - "thiserror", -] - -[[package]] -name = "quick-xml" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e21a144a0ffb5fad7b464babcdab934a325ad69b7c0373bcfef5cbd9799ca9" -dependencies = [ - "encoding_rs", - "memchr", -] - -[[package]] -name = "quick-xml" -version = "0.28.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" -dependencies = [ - "memchr", -] - -[[package]] -name = "quote" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "ratatui" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc0d032bccba900ee32151ec0265667535c230169f5a011154cdcd984e16829" -dependencies = [ - "bitflags", - "cassowary", - "crossterm", - "unicode-segmentation", - "unicode-width", -] - -[[package]] -name = "rayon" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom", - "redox_syscall 0.2.16", - "thiserror", -] - -[[package]] -name = "reedline" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31d763be5efcabcd27d6e804d126661215aa0a2d898c13c0aa1c953c6652fcec" -dependencies = [ - "chrono", - "crossterm", - "fd-lock", - "itertools", - "nu-ansi-term", - "rusqlite", - "serde", - "serde_json", - "strip-ansi-escapes", - "strum", - "strum_macros", - "thiserror", - "unicode-segmentation", - "unicode-width", -] - -[[package]] -name = "regex" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1a59b5d8e97dee33696bf13c5ba8ab85341c002922fba050069326b9c498974" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" - -[[package]] -name = "regex-syntax" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" - -[[package]] -name = "roxmltree" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f595a457b6b8c6cda66a48503e92ee8d19342f905948f29c383200ec9eb1d8" -dependencies = [ - "xmlparser", -] - -[[package]] -name = "rusqlite" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e213bc3ecb39ac32e81e51ebe31fd888a940515173e3a18a35f8c6e896422a" -dependencies = [ - "bitflags", - "fallible-iterator", - "fallible-streaming-iterator", - "hashlink", - "libsqlite3-sys", - "smallvec", -] - -[[package]] -name = "rust-embed" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b68543d5527e158213414a92832d2aab11a84d2571a5eb021ebe22c43aab066" -dependencies = [ - "rust-embed-impl", - "rust-embed-utils", - "walkdir", -] - -[[package]] -name = "rust-embed-impl" -version = "6.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4e0f0ced47ded9a68374ac145edd65a6c1fa13a96447b873660b2a568a0fd7" -dependencies = [ - "proc-macro2", - "quote", - "rust-embed-utils", - "syn 1.0.109", - "walkdir", -] - -[[package]] -name = "rust-embed-utils" -version = "7.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512b0ab6853f7e14e3c8754acb43d6f748bb9ced66aa5915a6553ac8213f7731" -dependencies = [ - "sha2", - "walkdir", -] - -[[package]] -name = "rust_decimal" -version = "1.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26bd36b60561ee1fb5ec2817f198b6fd09fa571c897a5e86d1487cfc2b096dfc" -dependencies = [ - "arrayvec 0.7.2", - "num-traits", -] - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustix" -version = "0.36.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e4d67015953998ad0eb82887a0eb0129e18a7e2f3b7b0f6c422fddcd503d62" -dependencies = [ - "bitflags", - "errno 0.3.1", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - -[[package]] -name = "rustix" -version = "0.37.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" -dependencies = [ - "bitflags", - "errno 0.3.1", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustversion" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" - -[[package]] -name = "ryu" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" -dependencies = [ - "windows-sys 0.42.0", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "security-framework" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "serde" -version = "1.0.163" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.163" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.16", -] - -[[package]] -name = "serde_json" -version = "1.0.96" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_yaml" -version = "0.9.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest", -] - -[[package]] -name = "shadow-rs" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427f07ab5f873000cf55324882e12a88c0a7ea7025df4fc1e7e35e688877a583" -dependencies = [ - "const_format", - "is_debug", - "time 0.3.21", -] - -[[package]] -name = "shell-words" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" - -[[package]] -name = "shlex" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" - -[[package]] -name = "signal-hook" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-mio" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" -dependencies = [ - "libc", - "mio 0.8.6", - "signal-hook", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - -[[package]] -name = "similar" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" - -[[package]] -name = "siphasher" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" - -[[package]] -name = "slab" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "smawk" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" - -[[package]] -name = "snapbox" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bccd62078347f89a914e3004d94582e13824d4e3d8a816317862884c423835" -dependencies = [ - "anstream", - "anstyle", - "normalize-line-endings", - "similar", - "snapbox-macros", -] - -[[package]] -name = "snapbox-macros" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaaf09df9f0eeae82be96290918520214530e738a7fe5a351b0f24cf77c0ca31" -dependencies = [ - "anstream", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strip-ansi-escapes" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "011cbb39cf7c1f62871aea3cc46e5817b0937b49e9447370c93cacbe93a766d8" -dependencies = [ - "vte", -] - -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", -] - -[[package]] -name = "supports-color" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4950e7174bffabe99455511c39707310e7e9b440364a2fcb1cc21521be57b354" -dependencies = [ - "is-terminal", - "is_ci", -] - -[[package]] -name = "supports-hyperlinks" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d" -dependencies = [ - "is-terminal", -] - -[[package]] -name = "supports-unicode" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6c2cb240ab5dd21ed4906895ee23fe5a48acdbd15a3ce388e7b62a9b66baf7" -dependencies = [ - "is-terminal", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sys-locale" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0b9eefabb91675082b41eb94c3ecd91af7656caee3fb4961a07c0ec8c7ca6f" -dependencies = [ - "libc", - "windows-sys 0.45.0", -] - -[[package]] -name = "sysinfo" -version = "0.28.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2f3ca6693feb29a89724516f016488e9aafc7f37264f898593ee4b942f31b" -dependencies = [ - "cfg-if 1.0.0", - "core-foundation-sys", - "libc", - "ntapi", - "once_cell", - "rayon", - "winapi 0.3.9", -] - -[[package]] -name = "tabled" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da1a2e56bbf7bfdd08aaa7592157a742205459eff774b73bc01809ae2d99dc2a" -dependencies = [ - "ansi-str", - "ansitok", - "papergrid", - "tabled_derive", - "unicode-width", -] - -[[package]] -name = "tabled_derive" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99f688a08b54f4f02f0a3c382aefdb7884d3d69609f785bd253dc033243e3fe4" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "tempfile" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" -dependencies = [ - "cfg-if 1.0.0", - "fastrand", - "redox_syscall 0.3.5", - "rustix 0.37.19", - "windows-sys 0.45.0", -] - -[[package]] -name = "terminal_size" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" -dependencies = [ - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "terminal_size" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" -dependencies = [ - "rustix 0.37.19", - "windows-sys 0.48.0", -] - -[[package]] -name = "textwrap" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" -dependencies = [ - "smawk", - "unicode-linebreak", - "unicode-width", -] - -[[package]] -name = "thiserror" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.16", -] - -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", -] - -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi 0.3.9", -] - -[[package]] -name = "time" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" -dependencies = [ - "itoa", - "libc", - "num_threads", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" - -[[package]] -name = "time-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" -dependencies = [ - "time-core", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "titlecase" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38397a8cdb017cfeb48bf6c154d6de975ac69ffeed35980fde199d2ee0842042" -dependencies = [ - "joinery", - "lazy_static", - "regex", -] - -[[package]] -name = "toml" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.19.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d964908cec0d030b812013af25a0e57fddfadb1e066ecc6681d86253129d4f" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "typetag" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6898cc6f6a32698cc3e14d5632a14d2b23ed9f7b11e6b8e05ce685990acc22" -dependencies = [ - "erased-serde", - "inventory", - "once_cell", - "serde", - "typetag-impl", -] - -[[package]] -name = "typetag-impl" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3e1c30cedd24fc597f7d37a721efdbdc2b1acae012c1ef1218f4c7c2c0f3e7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.16", -] - -[[package]] -name = "umask" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec9a46c2549e35c054e0ffe281a3a6ec0007793db4df106604d37ed3f4d73d1c" -dependencies = [ - "thiserror", -] - -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" - -[[package]] -name = "unicode-ident" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" - -[[package]] -name = "unicode-linebreak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" -dependencies = [ - "hashbrown 0.12.3", - "regex", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "unsafe-libyaml" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" - -[[package]] -name = "ureq" -version = "2.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "338b31dd1314f68f3aabf3ed57ab922df95ffcd902476ca7ba3c4ce7b908c46d" -dependencies = [ - "base64 0.13.1", - "encoding_rs", - "flate2", - "log", - "native-tls", - "once_cell", - "serde", - "serde_json", - "url", -] - -[[package]] -name = "url" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "users" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4227e95324a443c9fcb06e03d4d85e91aabe9a5a02aa818688b6918b6af486" -dependencies = [ - "libc", - "log", -] - -[[package]] -name = "users" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24cc0f6d6f267b73e5a2cadf007ba8f9bc39c6a6f9666f8cf25ea809a153b032" -dependencies = [ - "libc", - "log", -] - -[[package]] -name = "utf8-width" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" - -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - -[[package]] -name = "uuid" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" -dependencies = [ - "getrandom", -] - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "vte" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbce692ab4ca2f1f3047fcf732430249c0e971bfdd2b234cf2c47ad93af5983" -dependencies = [ - "arrayvec 0.5.2", - "utf8parse", - "vte_generate_state_changes", -] - -[[package]] -name = "vte_generate_state_changes" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "walkdir" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.16", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.16", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" - -[[package]] -name = "wax" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c7a3bac6110ac062b7b422a442b7ee23e07209e2784a036654cab1e71bbafc" -dependencies = [ - "bstr", - "const_format", - "itertools", - "nom", - "nom-supreme", - "pori", - "regex", - "smallvec", - "thiserror", - "walkdir", -] - -[[package]] -name = "which" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" -dependencies = [ - "either", - "libc", - "once_cell", -] - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" -dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" - -[[package]] -name = "winnow" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" -dependencies = [ - "memchr", -] - -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if 1.0.0", - "windows-sys 0.48.0", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "xmlparser" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd" - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "byteorder", - "crc32fast", - "crossbeam-utils", - "flate2", -] diff --git a/Cargo.toml b/clap_complete_nushell/Cargo.toml similarity index 100% rename from Cargo.toml rename to clap_complete_nushell/Cargo.toml diff --git a/LICENSE-APACHE b/clap_complete_nushell/LICENSE-APACHE similarity index 100% rename from LICENSE-APACHE rename to clap_complete_nushell/LICENSE-APACHE diff --git a/LICENSE-MIT b/clap_complete_nushell/LICENSE-MIT similarity index 100% rename from LICENSE-MIT rename to clap_complete_nushell/LICENSE-MIT diff --git a/README.md b/clap_complete_nushell/README.md similarity index 100% rename from README.md rename to clap_complete_nushell/README.md diff --git a/examples/nushell_completion.rs b/clap_complete_nushell/examples/nushell_completion.rs similarity index 100% rename from examples/nushell_completion.rs rename to clap_complete_nushell/examples/nushell_completion.rs diff --git a/examples/sub_subcommands.rs b/clap_complete_nushell/examples/sub_subcommands.rs similarity index 100% rename from examples/sub_subcommands.rs rename to clap_complete_nushell/examples/sub_subcommands.rs diff --git a/src/lib.rs b/clap_complete_nushell/src/lib.rs similarity index 100% rename from src/lib.rs rename to clap_complete_nushell/src/lib.rs diff --git a/tests/common.rs b/clap_complete_nushell/tests/common.rs similarity index 100% rename from tests/common.rs rename to clap_complete_nushell/tests/common.rs diff --git a/tests/completion.rs b/clap_complete_nushell/tests/completion.rs similarity index 100% rename from tests/completion.rs rename to clap_complete_nushell/tests/completion.rs diff --git a/tests/nushell.rs b/clap_complete_nushell/tests/nushell.rs similarity index 100% rename from tests/nushell.rs rename to clap_complete_nushell/tests/nushell.rs diff --git a/tests/snapshots/aliases.nu b/clap_complete_nushell/tests/snapshots/aliases.nu similarity index 100% rename from tests/snapshots/aliases.nu rename to clap_complete_nushell/tests/snapshots/aliases.nu diff --git a/tests/snapshots/basic.nu b/clap_complete_nushell/tests/snapshots/basic.nu similarity index 100% rename from tests/snapshots/basic.nu rename to clap_complete_nushell/tests/snapshots/basic.nu diff --git a/tests/snapshots/feature_sample.nu b/clap_complete_nushell/tests/snapshots/feature_sample.nu similarity index 100% rename from tests/snapshots/feature_sample.nu rename to clap_complete_nushell/tests/snapshots/feature_sample.nu diff --git a/tests/snapshots/quoting.nu b/clap_complete_nushell/tests/snapshots/quoting.nu similarity index 100% rename from tests/snapshots/quoting.nu rename to clap_complete_nushell/tests/snapshots/quoting.nu diff --git a/tests/snapshots/special_commands.nu b/clap_complete_nushell/tests/snapshots/special_commands.nu similarity index 100% rename from tests/snapshots/special_commands.nu rename to clap_complete_nushell/tests/snapshots/special_commands.nu diff --git a/tests/snapshots/sub_subcommands.nu b/clap_complete_nushell/tests/snapshots/sub_subcommands.nu similarity index 100% rename from tests/snapshots/sub_subcommands.nu rename to clap_complete_nushell/tests/snapshots/sub_subcommands.nu diff --git a/tests/snapshots/value_hint.nu b/clap_complete_nushell/tests/snapshots/value_hint.nu similarity index 100% rename from tests/snapshots/value_hint.nu rename to clap_complete_nushell/tests/snapshots/value_hint.nu diff --git a/scripts/gen_readme.nu b/scripts/gen_readme.nu deleted file mode 100755 index 2871f067f69..00000000000 --- a/scripts/gen_readme.nu +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env nu - -let example_file = "examples/sub_subcommands.rs" - -def generate_url [baseurl: string, ...path: string] { - [$baseurl] - |append $path - |str join '/' -} - -def generate_preamble [user: string, repo: string] { - let baseurl = "https://img.shields.io" - let crates = "https://crates.io" - let docs = "https://docs.rs" - let github = "https://github.com" - let branch = "main" - - $"# ($repo)\n -Generates [Nushell]\((generate_url $github nushell/nushell)\) completions for [`clap`]\((generate_url $github clap-rs/clap)\) based CLIs\n -[![Crates.io]\((generate_url $baseurl crates/v $repo)\)]\((generate_url $crates crates $repo)\) -[![Crates.io]\((generate_url $baseurl crates/d $repo)\)]\((generate_url $crates crates $repo)\) -[![License]\(https://img.shields.io/badge/license-Apache%202.0-blue\)]\(LICENSE-APACHE\) -[![License]\(https://img.shields.io/badge/license-MIT-blue\)]\(LICENSE-MIT\) -[![docs.rs]\((generate_url $baseurl docsrs $repo)\)]\((generate_url $docs $repo)\) -[![Build Status]\((generate_url $baseurl github/actions/workflow/status $user $repo ci.yml)\)]\((generate_url $github $user $repo actions/workflows/ci.yml?query=branch%3A($branch))\) -[![GitHub last commit]\((generate_url $baseurl github/last-commit $user $repo)\)]\((generate_url $github $user $repo commits/($branch))\)\n\n" -} - -def code_to_md [title: string, lang: string, code: string] { - $"### ($title)\n\n```($lang)\n($code)\n```\n" -} - -def generate_md [file: path] { - let package = (open Cargo.toml | get package) - let user = ($package.authors | first | str replace ' <.*@.*>$' '') - let repo = $package.name - let stem = ($file | path parse | get stem) - let rust_code = (open -r $file) - let nu_code = (cargo run --quiet --example $stem) - let rust_example = (code_to_md myapp.rs rust $rust_code) - let nu_example = (code_to_md myapp.nu nu $nu_code) - - generate_preamble $user $repo - |lines - |append "## Examples\n" - |append $rust_example - |append $nu_example - |str join "\n" - |save -r -f README.md -} - -generate_md $example_file