summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Peter <mail@david-peter.de>2022-02-22 14:04:07 +0100
committerDavid Peter <mail@david-peter.de>2022-02-22 14:04:07 +0100
commitf2f1dd9d40af6524f2d7ca116d91128f43181cc7 (patch)
tree79f8d3d156cb0a0c52f7fa3072b803e145246e44
parent308bf5cd26f585225b12cd873effbf48cd2c186c (diff)
Update dependencies
-rw-r--r--Cargo.lock81
-rw-r--r--build.rs6
-rw-r--r--src/cli.rs (renamed from src/app.rs)18
-rw-r--r--src/command.rs6
-rw-r--r--src/main.rs4
5 files changed, 54 insertions, 61 deletions
diff --git a/Cargo.lock b/Cargo.lock
index d854693..70a29ef 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -13,9 +13,9 @@ dependencies = [
[[package]]
name = "anyhow"
-version = "1.0.53"
+version = "1.0.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0"
+checksum = "159bb86af3a200e19a068f4224eae4c8bb2d0fa054c7e5d1cacd5cef95e684cd"
[[package]]
name = "approx"
@@ -59,15 +59,18 @@ dependencies = [
[[package]]
name = "autocfg"
-version = "0.1.7"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"
+checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78"
+dependencies = [
+ "autocfg 1.1.0",
+]
[[package]]
name = "autocfg"
-version = "1.0.1"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "bitflags"
@@ -95,9 +98,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
-version = "3.0.14"
+version = "3.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b63edc3f163b3c71ec8aa23f9bd6070f77edbf3d1d198b164afa90ff00e4ec62"
+checksum = "6d76c22c9b9b215eeb8d016ad3a90417bd13cb24cf8142756e6472445876cab7"
dependencies = [
"atty",
"bitflags",
@@ -112,9 +115,9 @@ dependencies = [
[[package]]
name = "clap_complete"
-version = "3.0.5"
+version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be4dabb7e2f006497e1da045feaa512acf0686f76b68d94925da2d9422dcb521"
+checksum = "23eec4dd324308f49d8bf86a2732078c34d57955fec1e1d865554fc37c15d420"
dependencies = [
"clap",
]
@@ -224,9 +227,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
[[package]]
name = "getrandom"
-version = "0.2.4"
+version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c"
+checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77"
dependencies = [
"cfg-if",
"libc",
@@ -263,7 +266,7 @@ dependencies = [
"indicatif",
"libc",
"predicates",
- "rand 0.8.4",
+ "rand 0.8.5",
"rust_decimal",
"serde",
"serde_json",
@@ -280,7 +283,7 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg 1.1.0",
"hashbrown",
]
@@ -334,9 +337,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
-version = "0.2.117"
+version = "0.2.119"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c"
+checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4"
[[package]]
name = "memchr"
@@ -370,7 +373,7 @@ version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg 1.1.0",
"num-integer",
"num-traits",
]
@@ -381,7 +384,7 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg 1.1.0",
"num-traits",
]
@@ -391,7 +394,7 @@ version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg 1.1.0",
"num-traits",
]
@@ -401,7 +404,7 @@ version = "0.1.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg 1.1.0",
"num-integer",
"num-traits",
]
@@ -412,7 +415,7 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg 1.1.0",
"num-bigint",
"num-integer",
"num-traits",
@@ -424,7 +427,7 @@ version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg 1.1.0",
]
[[package]]
@@ -508,11 +511,11 @@ version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
dependencies = [
- "autocfg 0.1.7",
+ "autocfg 0.1.8",
"libc",
"rand_chacha 0.1.1",
"rand_core 0.4.2",
- "rand_hc 0.1.0",
+ "rand_hc",
"rand_isaac",
"rand_jitter",
"rand_os",
@@ -523,14 +526,13 @@ dependencies = [
[[package]]
name = "rand"
-version = "0.8.4"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
"libc",
"rand_chacha 0.3.1",
"rand_core 0.6.3",
- "rand_hc 0.3.1",
]
[[package]]
@@ -539,7 +541,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
dependencies = [
- "autocfg 0.1.7",
+ "autocfg 0.1.8",
"rand_core 0.3.1",
]
@@ -587,15 +589,6 @@ dependencies = [
]
[[package]]
-name = "rand_hc"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
-dependencies = [
- "rand_core 0.6.3",
-]
-
-[[package]]
name = "rand_isaac"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -635,7 +628,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"
dependencies = [
- "autocfg 0.1.7",
+ "autocfg 0.1.8",
"rand_core 0.4.2",
]
@@ -700,9 +693,9 @@ dependencies = [
[[package]]
name = "rust_decimal"
-version = "1.21.0"
+version = "1.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4214023b1223d02a4aad9f0bb9828317634a56530870a2eaf7200a99c0c10f68"
+checksum = "d37baa70cf8662d2ba1c1868c5983dda16ef32b105cce41fb5c47e72936a90b3"
dependencies = [
"arrayvec",
"num-traits",
@@ -737,9 +730,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.78"
+version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085"
+checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95"
dependencies = [
"itoa 1.0.1",
"ryu",
@@ -748,9 +741,9 @@ dependencies = [
[[package]]
name = "shell-words"
-version = "1.0.0"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6fa3938c99da4914afedd13bf3d79bcb6c277d1b2c398d23257a304d9e1b074"
+checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
[[package]]
name = "statistical"
diff --git a/build.rs b/build.rs
index ffcc676..0c3fe35 100644
--- a/build.rs
+++ b/build.rs
@@ -2,7 +2,7 @@ use std::fs;
use clap_complete::{generate_to, Shell};
-include!("src/app.rs");
+include!("src/cli.rs");
fn main() {
let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or_else(|| std::env::var_os("OUT_DIR"));
@@ -12,7 +12,7 @@ fn main() {
};
fs::create_dir_all(&outdir).unwrap();
- let mut app = build_app();
+ let mut command = build_command();
for shell in [
Shell::Bash,
Shell::Fish,
@@ -20,6 +20,6 @@ fn main() {
Shell::PowerShell,
Shell::Elvish,
] {
- generate_to(shell, &mut app, "hyperfine", &outdir).unwrap();
+ generate_to(shell, &mut command, "hyperfine", &outdir).unwrap();
}
}
diff --git a/src/app.rs b/src/cli.rs
index a0e76c4..5a31f9b 100644
--- a/src/app.rs
+++ b/src/cli.rs
@@ -1,23 +1,23 @@
use std::ffi::OsString;
-use clap::{crate_version, App, AppSettings, Arg, ArgMatches};
+use clap::{crate_version, AppSettings, Arg, ArgMatches, Command};
pub fn get_cli_arguments<'a, I, T>(args: I) -> ArgMatches
where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone + 'a,
{
- let app = build_app();
- app.get_matches_from(args)
+ let command = build_command();
+ command.get_matches_from(args)
}
-/// Build the clap app for parsing command line arguments
-fn build_app() -> App<'static> {
- App::new("hyperfine")
+/// Build the clap command for parsing command line arguments
+fn build_command() -> Command<'static> {
+ Command::new("hyperfine")
.version(crate_version!())
.setting(AppSettings::DeriveDisplayOrder)
- .setting(AppSettings::NextLineHelp)
- .setting(AppSettings::HidePossibleValues)
+ .next_line_help(true)
+ .hide_possible_values(true)
.max_term_width(90)
.about("A command-line benchmarking tool.")
.arg(
@@ -259,5 +259,5 @@ fn build_app() -> App<'static> {
#[test]
fn verify_app() {
- build_app().debug_assert();
+ build_command().debug_assert();
}
diff --git a/src/command.rs b/src/command.rs
index 2057e78..f38547a 100644
--- a/src/command.rs
+++ b/src/command.rs
@@ -351,7 +351,7 @@ impl<'a> fmt::Display for Command<'a> {
#[test]
fn test_build_commands_cross_product() {
- use crate::app::get_cli_arguments;
+ use crate::cli::get_cli_arguments;
let matches = get_cli_arguments(vec![
"hyperfine",
@@ -389,7 +389,7 @@ fn test_build_commands_cross_product() {
#[test]
fn test_build_parameter_list_commands() {
- use crate::app::get_cli_arguments;
+ use crate::cli::get_cli_arguments;
let matches = get_cli_arguments(vec![
"hyperfine",
@@ -410,7 +410,7 @@ fn test_build_parameter_list_commands() {
#[test]
fn test_build_parameter_scan_commands() {
- use crate::app::get_cli_arguments;
+ use crate::cli::get_cli_arguments;
let matches = get_cli_arguments(vec![
"hyperfine",
"echo {val}",
diff --git a/src/main.rs b/src/main.rs
index fcd2ae9..a8c6636 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,7 +1,7 @@
use std::env;
-use app::get_cli_arguments;
use benchmark::scheduler::Scheduler;
+use cli::get_cli_arguments;
use command::Commands;
use export::ExportManager;
use options::Options;
@@ -9,8 +9,8 @@ use options::Options;
use anyhow::Result;
use colored::*;
-pub mod app;
pub mod benchmark;
+pub mod cli;
pub mod command;
pub mod error;
pub mod export;