Update dependencies

This commit is contained in:
David Peter committed 2022-02-22 14:04:07 +01:00
1 parent 308bf5cd26
commit f2f1dd9d40
5 files changed
+54 -61

No files matched your search

+9 -9
View File
@@ -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();
}
+3 -3
View File
@@ -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}",
+2 -2
View File
@@ -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;