Skip to content
Myr

options.rs

This file

Path

src/options.rs

399 lines · 11.6 KiB · Rust

Last changed by

Address review commentsTavian Barnesbefore adoption3df63ba

History of this file

Take it

The walk stopped after 200 commits: lines older than 76dd9d4 point at it.

Implement --output={null,pipe,<FILE>}Tavian Barnesbefore adoption277807c

lines 1–2why, one step back
1use std::fs::File;
2use std::path::PathBuf;

Move Stdio extraction to enumDavid Peterbefore adoption9b8f2a9

line 3why, one step back
3use std::process::{Command, Stdio};

Implement --output={null,pipe,<FILE>}Tavian Barnesbefore adoption277807c

line 4why, one step back
4use std::{cmp, fmt, io};

Parse --shell option value as shell commandrhysdbefore adoptione2fdace

line 5why, one step back
5

New Scheduler structDavid Peterbefore adoption72d2772

line 6why, one step back
6use anyhow::ensure;

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

lines 7–9why, one step back
7use atty::Stream;
8use clap::ArgMatches;9

New Scheduler structDavid Peterbefore adoption72d2772

line 10why, one step back
10use crate::command::Commands;

Parse --shell option value as shell commandrhysdbefore adoptione2fdace

line 11why, one step back
11use crate::error::OptionsError;

Move a few modules to utilDavid Peterbefore adoption5c634c9

line 12why, one step back
12use crate::util::units::{Second, Unit};

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

line 13why, one step back
13

New Scheduler structDavid Peterbefore adoption72d2772

lines 14–15why, one step back
14use anyhow::Result;
15

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

lines 16–21why, one step back
16#[cfg(not(windows))]
17pub const DEFAULT_SHELL: &str = "sh";1819#[cfg(windows)]20pub const DEFAULT_SHELL: &str = "cmd.exe";21

Parse --shell option value as shell commandrhysdbefore adoptione2fdace

line 22why, one step back
22/// Shell to use for executing benchmarked commands

Add tests for options::Shellrhysdbefore adoption1b7d139

line 23why, one step back
23#[derive(Debug)]

Parse --shell option value as shell commandrhysdbefore adoptione2fdace

lines 24–26why, one step back
24pub enum Shell {
25 /// Default shell command26 Default(&'static str),

Fix clippy warningDavid Peterbefore adoption250db61

line 27why, one step back
27

Parse --shell option value as shell commandrhysdbefore adoptione2fdace

lines 28–41why, one step back
28 /// Custom shell command specified via --shell
29 Custom(Vec<String>),30}3132impl Default for Shell {33 fn default() -> Self {34 Shell::Default(DEFAULT_SHELL)35 }36}3738impl fmt::Display for Shell {39 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {40 match self {41 Shell::Default(cmd) => write!(f, "{}", cmd),

Add tests for options::Shellrhysdbefore adoption1b7d139

line 42why, one step back
42 Shell::Custom(cmdline) => write!(f, "{}", shell_words::join(cmdline)),

Parse --shell option value as shell commandrhysdbefore adoptione2fdace

lines 43–48why, one step back
43 }
44 }45}4647impl Shell {48 /// Parse given string as shell command line

Fix clippy warningsDavid Peterbefore adoptionf029a46

line 49why, one step back
49 pub fn parse_from_str<'a>(s: &str) -> Result<Self, OptionsError<'a>> {

Fix clippy warningsrhysdbefore adoptionf2bfedd

line 50why, one step back
50 let v = shell_words::split(s).map_err(OptionsError::ShellParseError)?;

Add tests for options::Shellrhysdbefore adoption1b7d139

line 51why, one step back
51 if v.is_empty() || v[0].is_empty() {

Parse --shell option value as shell commandrhysdbefore adoptione2fdace

lines 52–68why, one step back
52 return Err(OptionsError::EmptyShell);
53 }54 Ok(Shell::Custom(v))55 }5657 pub fn command(&self) -> Command {58 match self {59 Shell::Default(cmd) => Command::new(cmd),60 Shell::Custom(cmdline) => {61 let mut c = Command::new(&cmdline[0]);62 c.args(&cmdline[1..]);63 c64 }65 }66 }67}68

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

lines 69–97why, one step back
69/// Action to take when an executed command fails.
70#[derive(Debug, Clone, Copy, PartialEq)]71pub enum CmdFailureAction {72 /// Exit with an error message73 RaiseError,7475 /// Simply ignore the non-zero exit code76 Ignore,77}7879/// Output style type option80#[derive(Debug, Clone, Copy, PartialEq)]81pub enum OutputStyleOption {82 /// Do not output with colors or any special formatting83 Basic,8485 /// Output with full color and formatting86 Full,8788 /// Keep elements such as progress bar, but use no coloring89 NoColor,9091 /// Keep coloring, but use no progress bar92 Color,9394 /// Disable all the output95 Disabled,96}97

Rename Runs to RunBoundsDavid Peterbefore adoptionbea0cfa

lines 98–99why, one step back
98/// Bounds for the number of benchmark runs
99pub struct RunBounds {

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

lines 100–106why, one step back
100 /// Minimum number of benchmark runs
101 pub min: u64,102103 /// Maximum number of benchmark runs104 pub max: Option<u64>,105}106

Rename Runs to RunBoundsDavid Peterbefore adoptionbea0cfa

line 107why, one step back
107impl Default for RunBounds {

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 108why, one step back
108 fn default() -> Self {

Rename Runs to RunBoundsDavid Peterbefore adoptionbea0cfa

line 109why, one step back
109 RunBounds { min: 10, max: None }

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

lines 110–112why, one step back
110 }
111}112

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 113why, one step back
113/// How to handle the output of benchmarked commands

Implement --output={null,pipe,<FILE>}Tavian Barnesbefore adoption277807c

line 114why, one step back
114#[derive(Debug, Clone, PartialEq)]

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 115why, one step back
115pub enum CommandOutputPolicy {

Address review commentsTavian Barnesbefore adoption3df63ba

lines 116–117why, one step back
116 /// Redirect output to the null device
117 Null,

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

line 118why, one step back
118

Implement --output={null,pipe,<FILE>}Tavian Barnesbefore adoption277807c

lines 119–124why, one step back
119 /// Feed output through a pipe before discarding it
120 Pipe,121122 /// Redirect output to a file123 File(PathBuf),124

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 125why, one step back
125 /// Show command output on the terminal

Address review commentsTavian Barnesbefore adoption3df63ba

line 126why, one step back
126 Inherit,

Turn show_output into enumDavid Peterbefore adoption0ebd76d

lines 127–130why, one step back
127}
128129impl Default for CommandOutputPolicy {130 fn default() -> Self {

Address review commentsTavian Barnesbefore adoption3df63ba

line 131why, one step back
131 CommandOutputPolicy::Null

Move Stdio extraction to enumDavid Peterbefore adoption9b8f2a9

lines 132–135why, one step back
132 }
133}134135impl CommandOutputPolicy {

Implement --output={null,pipe,<FILE>}Tavian Barnesbefore adoption277807c

lines 136–137why, one step back
136 pub fn get_stdout_stderr(&self) -> io::Result<(Stdio, Stdio)> {
137 let streams = match self {

Address review commentsTavian Barnesbefore adoption3df63ba

line 138why, one step back
138 CommandOutputPolicy::Null => (Stdio::null(), Stdio::null()),

Implement --output={null,pipe,<FILE>}Tavian Barnesbefore adoption277807c

lines 139–147why, one step back
139
140 // Typically only stdout is performance-relevant, so just pipe that141 CommandOutputPolicy::Pipe => (Stdio::piped(), Stdio::null()),142143 CommandOutputPolicy::File(path) => {144 let file = File::create(&path)?;145 (file.into(), Stdio::null())146 }147

Address review commentsTavian Barnesbefore adoption3df63ba

line 148why, one step back
148 CommandOutputPolicy::Inherit => (Stdio::inherit(), Stdio::inherit()),

Implement --output={null,pipe,<FILE>}Tavian Barnesbefore adoption277807c

lines 149–151why, one step back
149 };
150151 Ok(streams)

Turn show_output into enumDavid Peterbefore adoption0ebd76d

lines 152–154why, one step back
152 }
153}154

Add debug/mock modeDavid Peterbefore adoption6f51232

line 155why, one step back
155pub enum ExecutorKind {

Use raw executor by default, skip intermediate shellDavid Peterbefore adoptiond9418e0

line 156why, one step back
156 Raw,

Add debug/mock modeDavid Peterbefore adoption6f51232

line 157why, one step back
157 Shell(Shell),

Proper shell overhead computationDavid Peterbefore adoption6887835

line 158why, one step back
158 Mock(Option<String>),

Add debug/mock modeDavid Peterbefore adoption6f51232

lines 159–166why, one step back
159}
160161impl Default for ExecutorKind {162 fn default() -> Self {163 ExecutorKind::Shell(Shell::default())164 }165}166

Turn show_output into enumDavid Peterbefore adoption0ebd76d

lines 167–168why, one step back
167/// The main settings for a hyperfine benchmark session
168pub struct Options {

Rename Runs to RunBoundsDavid Peterbefore adoptionbea0cfa

lines 169–170why, one step back
169 /// Upper and lower bound for the number of benchmark runs
170 pub run_bounds: RunBounds,

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

line 171why, one step back
171

Turn show_output into enumDavid Peterbefore adoption0ebd76d

lines 172–174why, one step back
172 /// Number of warmup runs
173 pub warmup_count: u64,174

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

line 175why, one step back
175 /// Minimum benchmarking time

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 176why, one step back
176 pub min_benchmarking_time: Second,

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

lines 177–178why, one step back
177
178 /// Whether or not to ignore non-zero exit codes

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 179why, one step back
179 pub command_failure_action: CmdFailureAction,

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

line 180why, one step back
180

Rename parse to from_strDavid Peterbefore adoptionf9e62e5

line 181why, one step back
181 /// Command(s) to run before each timing run

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

lines 182–183why, one step back
182 pub preparation_command: Option<Vec<String>>,
183

Turn show_output into enumDavid Peterbefore adoption0ebd76d

lines 184–187why, one step back
184 /// Command to run before each *batch* of timing runs, i.e. before each individual benchmark
185 pub setup_command: Option<String>,186187 /// Command to run after each *batch* of timing runs, i.e. after each individual benchmark

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

lines 188–189why, one step back
188 pub cleanup_command: Option<String>,
189

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 190why, one step back
190 /// What color mode to use for the terminal output

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

lines 191–192why, one step back
191 pub output_style: OutputStyleOption,
192

Add debug/mock modeDavid Peterbefore adoption6f51232

lines 193–194why, one step back
193 /// Determines how we run commands
194 pub executor_kind: ExecutorKind,

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

line 195why, one step back
195

Turn show_output into enumDavid Peterbefore adoption0ebd76d

lines 196–197why, one step back
196 /// What to do with the output of the benchmarked command
197 pub command_output_policy: CommandOutputPolicy,

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

line 198why, one step back
198

Remove unused optionDavid Peterbefore adoption21f76a3

line 199why, one step back
199 /// Which time unit to use when displaying resuls

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

lines 200–202why, one step back
200 pub time_unit: Option<Unit>,
201}202

Rename to OptionsDavid Peterbefore adoptionb54b2f8

lines 203–205why, one step back
203impl Default for Options {
204 fn default() -> Options {205 Options {

Rename Runs to RunBoundsDavid Peterbefore adoptionbea0cfa

line 206why, one step back
206 run_bounds: RunBounds::default(),

Remove unused optionDavid Peterbefore adoption21f76a3

line 207why, one step back
207 warmup_count: 0,

Turn show_output into enumDavid Peterbefore adoption0ebd76d

lines 208–209why, one step back
208 min_benchmarking_time: 3.0,
209 command_failure_action: CmdFailureAction::RaiseError,

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

line 210why, one step back
210 preparation_command: None,

Remove unused optionDavid Peterbefore adoption21f76a3

line 211why, one step back
211 setup_command: None,

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

lines 212–213why, one step back
212 cleanup_command: None,
213 output_style: OutputStyleOption::Full,

Add debug/mock modeDavid Peterbefore adoption6f51232

line 214why, one step back
214 executor_kind: ExecutorKind::default(),

Address review commentsTavian Barnesbefore adoption3df63ba

line 215why, one step back
215 command_output_policy: CommandOutputPolicy::Null,

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

lines 216–217why, one step back
216 time_unit: None,
217 }

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

lines 218–220why, one step back
218 }
219}220

Rename to OptionsDavid Peterbefore adoptionb54b2f8

line 221why, one step back
221impl Options {

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

lines 222–245why, one step back
222 pub fn from_cli_arguments<'a>(matches: &ArgMatches) -> Result<Self, OptionsError<'a>> {
223 let mut options = Self::default();224 let param_to_u64 = |param| {225 matches226 .value_of(param)227 .map(|n| {228 n.parse::<u64>()229 .map_err(|e| OptionsError::NumericParsingError(param, e))230 })231 .transpose()232 };233234 options.warmup_count = param_to_u64("warmup")?.unwrap_or(options.warmup_count);235236 let mut min_runs = param_to_u64("min-runs")?;237 let mut max_runs = param_to_u64("max-runs")?;238239 if let Some(runs) = param_to_u64("runs")? {240 min_runs = Some(runs);241 max_runs = Some(runs);242 }243244 match (min_runs, max_runs) {245 (Some(min), None) => {

Rename Runs to RunBoundsDavid Peterbefore adoptionbea0cfa

line 246why, one step back
246 options.run_bounds.min = min;

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

lines 247–249why, one step back
247 }
248 (None, Some(max)) => {249 // Since the minimum was not explicit we lower it if max is below the default min.

Rename Runs to RunBoundsDavid Peterbefore adoptionbea0cfa

lines 250–251why, one step back
250 options.run_bounds.min = cmp::min(options.run_bounds.min, max);
251 options.run_bounds.max = Some(max);

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

lines 252–256why, one step back
252 }
253 (Some(min), Some(max)) if min > max => {254 return Err(OptionsError::EmptyRunsRange);255 }256 (Some(min), Some(max)) => {

Rename Runs to RunBoundsDavid Peterbefore adoptionbea0cfa

lines 257–258why, one step back
257 options.run_bounds.min = min;
258 options.run_bounds.max = Some(max);

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

lines 259–270why, one step back
259 }
260 (None, None) => {}261 };262263 options.setup_command = matches.value_of("setup").map(String::from);264265 options.preparation_command = matches266 .values_of("prepare")267 .map(|values| values.map(String::from).collect::<Vec<String>>());268269 options.cleanup_command = matches.value_of("cleanup").map(String::from);270

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 271why, one step back
271 options.command_output_policy = if matches.is_present("show-output") {

Address review commentsTavian Barnesbefore adoption3df63ba

line 272why, one step back
272 CommandOutputPolicy::Inherit

Implement --output={null,pipe,<FILE>}Tavian Barnesbefore adoption277807c

lines 273–274why, one step back
273 } else if let Some(output) = matches.value_of("output") {
274 match output {

Address review commentsTavian Barnesbefore adoption3df63ba

line 275why, one step back
275 "null" => CommandOutputPolicy::Null,

Implement --output={null,pipe,<FILE>}Tavian Barnesbefore adoption277807c

line 276why, one step back
276 "pipe" => CommandOutputPolicy::Pipe,

Address review commentsTavian Barnesbefore adoption3df63ba

line 277why, one step back
277 "inherit" => CommandOutputPolicy::Inherit,

Forbid --output=file without a path separatorTavian Barnesbefore adoptionefdf735

lines 278–284why, one step back
278 arg => {
279 let path = PathBuf::from(arg);280 if path.components().count() <= 1 {281 return Err(OptionsError::UnknownOutputPolicy(arg.to_string()));282 }283 CommandOutputPolicy::File(path)284 }

Implement --output={null,pipe,<FILE>}Tavian Barnesbefore adoption277807c

line 285why, one step back
285 }

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 286why, one step back
286 } else {

Address review commentsTavian Barnesbefore adoption3df63ba

line 287why, one step back
287 CommandOutputPolicy::Null

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 288why, one step back
288 };

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

lines 289–296why, one step back
289
290 options.output_style = match matches.value_of("style") {291 Some("full") => OutputStyleOption::Full,292 Some("basic") => OutputStyleOption::Basic,293 Some("nocolor") => OutputStyleOption::NoColor,294 Some("color") => OutputStyleOption::Color,295 Some("none") => OutputStyleOption::Disabled,296 _ => {

Address review commentsTavian Barnesbefore adoption3df63ba

lines 297–298why, one step back
297 if options.command_output_policy == CommandOutputPolicy::Inherit
298 || !atty::is(Stream::Stdout)

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 299why, one step back
299 {

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

line 300why, one step back
300 OutputStyleOption::Basic

Address review commentsTavian Barnesbefore adoption3df63ba

lines 301–302why, one step back
301 } else {
302 OutputStyleOption::Full

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

lines 303–316why, one step back
303 }
304 }305 };306307 match options.output_style {308 OutputStyleOption::Basic | OutputStyleOption::NoColor => {309 colored::control::set_override(false)310 }311 OutputStyleOption::Full | OutputStyleOption::Color => {312 colored::control::set_override(true)313 }314 OutputStyleOption::Disabled => {}315 };316

Switch to --shell=none/-N, do not change the defaultDavid Peterbefore adoption365ff25

lines 317–327why, one step back
317 options.executor_kind = if matches.is_present("no-shell") {
318 ExecutorKind::Raw319 } else {320 match (matches.is_present("debug-mode"), matches.value_of("shell")) {321 (false, Some(shell)) if shell == "default" => ExecutorKind::Shell(Shell::default()),322 (false, Some(shell)) if shell == "none" => ExecutorKind::Raw,323 (false, Some(shell)) => ExecutorKind::Shell(Shell::parse_from_str(shell)?),324 (false, None) => ExecutorKind::Shell(Shell::default()),325 (true, Some(shell)) => ExecutorKind::Mock(Some(shell.into())),326 (true, None) => ExecutorKind::Mock(None),327 }

Add debug/mock modeDavid Peterbefore adoption6f51232

line 328why, one step back
328 };

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

lines 329–330why, one step back
329
330 if matches.is_present("ignore-failure") {

Turn show_output into enumDavid Peterbefore adoption0ebd76d

line 331why, one step back
331 options.command_failure_action = CmdFailureAction::Ignore;

Move convert_cli_arguments_to_options to HyperfineOptionsDavid Peterbefore adoption39a85b8

lines 332–340why, one step back
332 }
333334 options.time_unit = match matches.value_of("time-unit") {335 Some("millisecond") => Some(Unit::MilliSecond),336 Some("second") => Some(Unit::Second),337 _ => None,338 };339340 Ok(options)

New Scheduler structDavid Peterbefore adoption72d2772

lines 341–345why, one step back
341 }
342343 pub fn validate_against_command_list(&self, commands: &Commands) -> Result<()> {344 if let Some(preparation_command) = &self.preparation_command {345 ensure!(

Fix clippy warningDavid Peterbefore adoption250db61

lines 346–347why, one step back
346 preparation_command.len() <= 1
347 || commands.num_commands() == preparation_command.len(),

New Scheduler structDavid Peterbefore adoption72d2772

lines 348–353why, one step back
348 "The '--prepare' option has to be provided just once or N times, where N is the \
349 number of benchmark commands."350 );351 }352353 Ok(())

Add tests for options::Shellrhysdbefore adoption1b7d139

lines 354–357why, one step back
354 }
355}356357#[test]

Rename testDavid Peterbefore adoption811e6b5

line 358why, one step back
358fn test_default_shell() {

Add tests for options::Shellrhysdbefore adoption1b7d139

lines 359–364why, one step back
359 let shell = Shell::default();
360361 let s = format!("{}", shell);362 assert_eq!(&s, DEFAULT_SHELL);363364 let cmd = shell.command();

Use get_programDavid Peterbefore adoption6645fa1

line 365why, one step back
365 assert_eq!(cmd.get_program(), DEFAULT_SHELL);

Add tests for options::Shellrhysdbefore adoption1b7d139

lines 366–368why, one step back
366}
367368#[test]

Rename parse to from_strDavid Peterbefore adoptionf9e62e5

line 369why, one step back
369fn test_can_parse_shell_command_line_from_str() {

Fix clippy warningsDavid Peterbefore adoptionf029a46

line 370why, one step back
370 let shell = Shell::parse_from_str("shell -x 'aaa bbb'").unwrap();

Add tests for options::Shellrhysdbefore adoption1b7d139

lines 371–375why, one step back
371
372 let s = format!("{}", shell);373 assert_eq!(&s, "shell -x 'aaa bbb'");374375 let cmd = shell.command();

Fix clippy suggestionsDavid Peterbefore adoptionf5de548

lines 376–382why, one step back
376 assert_eq!(cmd.get_program().to_string_lossy(), "shell");
377 assert_eq!(378 cmd.get_args()379 .map(|a| a.to_string_lossy())380 .collect::<Vec<_>>(),381 vec!["-x", "aaa bbb"]382 );

Add tests for options::Shellrhysdbefore adoption1b7d139

lines 383–384why, one step back
383
384 // Error cases

Fix clippy suggestionsDavid Peterbefore adoptionf5de548

line 385why, one step back
385 assert!(matches!(

Fix clippy warningsDavid Peterbefore adoptionf029a46

line 386why, one step back
386 Shell::parse_from_str("shell 'foo").unwrap_err(),

Fix clippy suggestionsDavid Peterbefore adoptionf5de548

lines 387–388why, one step back
387 OptionsError::ShellParseError(_)
388 ));

Add tests for options::Shellrhysdbefore adoption1b7d139

line 389why, one step back
389

Fix formattingDavid Peterbefore adoptiona35e7e2

line 390why, one step back
390 assert!(matches!(

Fix clippy warningsDavid Peterbefore adoptionf029a46

line 391why, one step back
391 Shell::parse_from_str("").unwrap_err(),

Fix formattingDavid Peterbefore adoptiona35e7e2

lines 392–393why, one step back
392 OptionsError::EmptyShell
393 ));

Add tests for options::Shellrhysdbefore adoption1b7d139

line 394why, one step back
394

Fix formattingDavid Peterbefore adoptiona35e7e2

line 395why, one step back
395 assert!(matches!(

Fix clippy warningsDavid Peterbefore adoptionf029a46

line 396why, one step back
396 Shell::parse_from_str("''").unwrap_err(),

Fix formattingDavid Peterbefore adoptiona35e7e2

lines 397–398why, one step back
397 OptionsError::EmptyShell
398 ));

Move relative-speed computation to separate moduleDavid Peterbefore adoption76dd9d4

line 399why, one step back
399}