1use crate::{cmd, Builder};
2use std::env;
3
4pub trait CommandLineExt: Sized {
6 fn add_command_line(self) -> Self;
8
9 fn add_command_line_map<S: AsRef<str>>(self, switch_mappings: &[(S, S)]) -> Self;
15}
16
17impl CommandLineExt for Builder {
18 fn add_command_line(mut self) -> Self {
19 self.add(cmd::Provider::from(env::args()));
20 self
21 }
22
23 fn add_command_line_map<S: AsRef<str>>(mut self, switch_mappings: &[(S, S)]) -> Self {
24 self.add(cmd::Provider::new(env::args(), switch_mappings));
25 self
26 }
27}