diff --git a/Cargo.lock b/Cargo.lock index 4d915e9..00cab14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "arbitrary" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25e0a02cf12f1b1f48b14cb7f8217b876d09992b39c816ffb3b1ba64dd979a87" +checksum = "5a7924531f38b1970ff630f03eb20a2fde69db5c590c93b0f3482e95dcc5fd60" dependencies = [ "derive_arbitrary", ] @@ -125,16 +125,16 @@ dependencies = [ [[package]] name = "clap" -version = "3.1.18" +version = "3.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" +checksum = "a3dbbb6653e7c55cc8595ad3e1f7be8f32aba4eb7ff7f0fd1163d4f3d137c0a9" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", "indexmap", - "lazy_static", + "once_cell", "termcolor", "terminal_size", "textwrap 0.15.0", @@ -142,9 +142,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.18" +version = "3.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c" +checksum = "9ba52acd3b0a5c33aeada5cdaa3267cdc7c594a98731d4268cdc1532f4264cb4" dependencies = [ "heck", "proc-macro-error", @@ -155,9 +155,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" dependencies = [ "os_str_bytes", ] @@ -246,9 +246,9 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8728db27dd9033a7456655aaeb35fde74425d0f130b4cb18a19171ef38a1b454" +checksum = "c9a577516173adb681466d517d39bd468293bc2c2a16439375ef0f35bba45f3d" dependencies = [ "proc-macro2", "quote", @@ -473,9 +473,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" +checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" [[package]] name = "oorandom" @@ -594,7 +594,7 @@ name = "pomsky-bin" version = "0.5.0" dependencies = [ "atty", - "clap 3.1.18", + "clap 3.2.16", "miette", "owo-colors", "pomsky", @@ -676,9 +676,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.6" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -687,9 +687,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.26" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "rustc_version" @@ -879,18 +879,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ "proc-macro2", "quote", diff --git a/pomsky-bin/Cargo.toml b/pomsky-bin/Cargo.toml index ae8b554..823826b 100644 --- a/pomsky-bin/Cargo.toml +++ b/pomsky-bin/Cargo.toml @@ -20,11 +20,11 @@ path = "src/main.rs" [dependencies] atty = "0.2.14" -thiserror = "1.0.30" +thiserror = "1.0.32" owo-colors = { version = "3.4.0", features = ["supports-color"] } [dependencies.miette] -version = "4.2.1" +version = "4.7.1" features = ["fancy-no-backtrace"] [dependencies.pomsky] @@ -33,6 +33,6 @@ path = "../pomsky-lib" features = ["dbg", "miette", "suggestions"] [dependencies.clap] -version = "3.1.0" +version = "3.2.16" default-features = false features = ["std", "derive", "wrap_help", "color"] diff --git a/pomsky-bin/src/main.rs b/pomsky-bin/src/main.rs index 21cb6b7..f02c559 100644 --- a/pomsky-bin/src/main.rs +++ b/pomsky-bin/src/main.rs @@ -1,4 +1,7 @@ -use std::io::{self, Read, Write}; +use std::{ + io::{self, Read, Write}, + process::exit, +}; use atty::Stream; use clap::Parser as _; @@ -28,6 +31,7 @@ pub fn main() { error.to_string(), None, )); + exit(2); } }, (None, None) if atty::isnt(Stream::Stdin) => { @@ -43,6 +47,7 @@ pub fn main() { format!("Could not parse stdin: {e}"), None, )); + exit(3); } } } @@ -53,6 +58,7 @@ pub fn main() { "You can only provide an input or a path, but not both".into(), None, )); + exit(4); } (None, None) => { print_diagnostic(&Diagnostic::ad_hoc( @@ -61,6 +67,7 @@ pub fn main() { "No input provided".into(), None, )); + exit(5); } } } @@ -71,7 +78,7 @@ fn compile(input: &str, args: &Args) { Ok(res) => res, Err(err) => { print_parse_error(err, input); - std::process::exit(1); + exit(1); } }; diff --git a/pomsky-lib/Cargo.toml b/pomsky-lib/Cargo.toml index 5969745..fbd699e 100644 --- a/pomsky-lib/Cargo.toml +++ b/pomsky-lib/Cargo.toml @@ -21,12 +21,12 @@ dbg = [] suggestions = ["strsim"] [dependencies] -thiserror = "1.0.31" -nom = "7.1.0" +thiserror = "1.0.32" +nom = "7.1.1" strsim = { version = "0.10.0", optional = true } [dependencies.arbitrary] -version = "1.1.2" +version = "1.1.3" features = ["derive"] optional = true @@ -36,8 +36,8 @@ optional = true [dev-dependencies] atty = "0.2.14" -once_cell = "1.12.0" -regex = "1.5.6" +once_cell = "1.13.0" +regex = "1.6.0" [[test]] name = "it"