Start implementing a verbose mode
This commit is contained in:
parent
b54851a37a
commit
f2771f7953
4 changed files with 18 additions and 5 deletions
|
@ -20,4 +20,4 @@ toolchain.
|
|||
- `FFSEND_OPEN`: open an uploaded file (present/boolean)
|
||||
- `FFSEND_ARCHIVE`: enable file archival (present/boolean)
|
||||
- `FFSEND_COPY`: copy share URL to clipboard (present/boolean)
|
||||
|
||||
- `FFSEND_VERBOSE`: copy share URL to clipboard (present/boolean)
|
||||
|
|
|
@ -222,10 +222,12 @@ impl<'a> Upload<'a> {
|
|||
Cell::new("Share URL:"),
|
||||
Cell::new(url.as_str()),
|
||||
]));
|
||||
table.add_row(Row::new(vec![
|
||||
Cell::new("Owner token:"),
|
||||
Cell::new(file.owner_token().unwrap()),
|
||||
]));
|
||||
if matcher_main.verbose() {
|
||||
table.add_row(Row::new(vec![
|
||||
Cell::new("Owner token:"),
|
||||
Cell::new(file.owner_token().unwrap()),
|
||||
]));
|
||||
}
|
||||
table.printstd();
|
||||
|
||||
// Add the file to the history manager
|
||||
|
|
|
@ -75,6 +75,12 @@ impl<'a: 'b, 'b> Handler<'a> {
|
|||
.alias("assume-yes")
|
||||
.global(true)
|
||||
.help("Assume yes for prompts"))
|
||||
.arg(Arg::with_name("verbose")
|
||||
.long("verbose")
|
||||
.short("v")
|
||||
.multiple(true)
|
||||
.global(true)
|
||||
.help("Enable verbose information and logging"))
|
||||
.subcommand(CmdDebug::build())
|
||||
.subcommand(CmdDelete::build())
|
||||
.subcommand(CmdDownload::build().display_order(2))
|
||||
|
|
|
@ -54,6 +54,11 @@ impl<'a: 'b, 'b> MainMatcher<'a> {
|
|||
pub fn incognito(&self) -> bool {
|
||||
self.matches.is_present("incognito") || env_var_present("FFSEND_INCOGNITO")
|
||||
}
|
||||
|
||||
/// Check whether verbose mode is used.
|
||||
pub fn verbose(&self) -> bool {
|
||||
self.matches.is_present("verbose") || env_var_present("FFSEND_VERBOSE")
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Matcher<'a> for MainMatcher<'a> {
|
||||
|
|
Loading…
Add table
Reference in a new issue