mirror of
https://github.com/timvisee/ffsend.git
synced 2025-10-06 02:29:57 +02:00
Reformat using rustfmt
This commit is contained in:
parent
4d5c0391cb
commit
560b462f21
4 changed files with 22 additions and 11 deletions
|
@ -67,7 +67,8 @@ impl<'a> Info<'a> {
|
||||||
.invoke(&client)
|
.invoke(&client)
|
||||||
.map_err(|err| {
|
.map_err(|err| {
|
||||||
print_error(err.context("failed to fetch file metadata, showing limited info"))
|
print_error(err.context("failed to fetch file metadata, showing limited info"))
|
||||||
}).ok();
|
})
|
||||||
|
.ok();
|
||||||
|
|
||||||
// Get the TTL duration
|
// Get the TTL duration
|
||||||
let ttl_millis = info.ttl_millis() as i64;
|
let ttl_millis = info.ttl_millis() as i64;
|
||||||
|
|
|
@ -41,7 +41,8 @@ impl<'a: 'b, 'b> Handler<'a> {
|
||||||
The public Send service that is used as default host is provided by Mozilla.\n\
|
The public Send service that is used as default host is provided by Mozilla.\n\
|
||||||
This application is not affiliated with Mozilla, Firefox or Firefox Send.\
|
This application is not affiliated with Mozilla, Firefox or Firefox Send.\
|
||||||
",
|
",
|
||||||
).global_setting(AppSettings::GlobalVersion)
|
)
|
||||||
|
.global_setting(AppSettings::GlobalVersion)
|
||||||
.global_setting(AppSettings::VersionlessSubcommands)
|
.global_setting(AppSettings::VersionlessSubcommands)
|
||||||
// TODO: enable below command when it doesn't break `p` anymore.
|
// TODO: enable below command when it doesn't break `p` anymore.
|
||||||
// .global_setting(AppSettings::InferSubcommands)
|
// .global_setting(AppSettings::InferSubcommands)
|
||||||
|
@ -51,28 +52,32 @@ impl<'a: 'b, 'b> Handler<'a> {
|
||||||
.short("f")
|
.short("f")
|
||||||
.global(true)
|
.global(true)
|
||||||
.help("Force the action, ignore warnings"),
|
.help("Force the action, ignore warnings"),
|
||||||
).arg(
|
)
|
||||||
|
.arg(
|
||||||
Arg::with_name("no-interact")
|
Arg::with_name("no-interact")
|
||||||
.long("no-interact")
|
.long("no-interact")
|
||||||
.short("I")
|
.short("I")
|
||||||
.alias("no-interactive")
|
.alias("no-interactive")
|
||||||
.global(true)
|
.global(true)
|
||||||
.help("Not interactive, do not prompt"),
|
.help("Not interactive, do not prompt"),
|
||||||
).arg(
|
)
|
||||||
|
.arg(
|
||||||
Arg::with_name("yes")
|
Arg::with_name("yes")
|
||||||
.long("yes")
|
.long("yes")
|
||||||
.short("y")
|
.short("y")
|
||||||
.alias("assume-yes")
|
.alias("assume-yes")
|
||||||
.global(true)
|
.global(true)
|
||||||
.help("Assume yes for prompts"),
|
.help("Assume yes for prompts"),
|
||||||
).arg(
|
)
|
||||||
|
.arg(
|
||||||
Arg::with_name("verbose")
|
Arg::with_name("verbose")
|
||||||
.long("verbose")
|
.long("verbose")
|
||||||
.short("v")
|
.short("v")
|
||||||
.multiple(true)
|
.multiple(true)
|
||||||
.global(true)
|
.global(true)
|
||||||
.help("Enable verbose information and logging"),
|
.help("Enable verbose information and logging"),
|
||||||
).subcommand(CmdDebug::build())
|
)
|
||||||
|
.subcommand(CmdDebug::build())
|
||||||
.subcommand(CmdDelete::build())
|
.subcommand(CmdDelete::build())
|
||||||
.subcommand(CmdDownload::build().display_order(2))
|
.subcommand(CmdDownload::build().display_order(2))
|
||||||
.subcommand(CmdExists::build())
|
.subcommand(CmdExists::build())
|
||||||
|
@ -95,7 +100,8 @@ impl<'a: 'b, 'b> Handler<'a> {
|
||||||
.hide_default_value(true)
|
.hide_default_value(true)
|
||||||
.env("FFSEND_HISTORY")
|
.env("FFSEND_HISTORY")
|
||||||
.hide_env_values(true),
|
.hide_env_values(true),
|
||||||
).arg(
|
)
|
||||||
|
.arg(
|
||||||
Arg::with_name("incognito")
|
Arg::with_name("incognito")
|
||||||
.long("incognito")
|
.long("incognito")
|
||||||
.short("i")
|
.short("i")
|
||||||
|
@ -104,7 +110,8 @@ impl<'a: 'b, 'b> Handler<'a> {
|
||||||
.alias("priv")
|
.alias("priv")
|
||||||
.global(true)
|
.global(true)
|
||||||
.help("Don't update local history for actions"),
|
.help("Don't update local history for actions"),
|
||||||
).subcommand(CmdHistory::build());
|
)
|
||||||
|
.subcommand(CmdHistory::build());
|
||||||
|
|
||||||
// Disable color usage if compiled without color support
|
// Disable color usage if compiled without color support
|
||||||
#[cfg(feature = "no-color")]
|
#[cfg(feature = "no-color")]
|
||||||
|
|
|
@ -19,7 +19,8 @@ impl CmdUpload {
|
||||||
.help("The file to upload")
|
.help("The file to upload")
|
||||||
.required(true)
|
.required(true)
|
||||||
.multiple(false),
|
.multiple(false),
|
||||||
).arg(ArgPassword::build().help("Protect the file with a password"))
|
)
|
||||||
|
.arg(ArgPassword::build().help("Protect the file with a password"))
|
||||||
.arg(ArgGenPassphrase::build())
|
.arg(ArgGenPassphrase::build())
|
||||||
.arg(ArgDownloadLimit::build().default_value(DOWNLOAD_DEFAULT))
|
.arg(ArgDownloadLimit::build().default_value(DOWNLOAD_DEFAULT))
|
||||||
.arg(ArgHost::build())
|
.arg(ArgHost::build())
|
||||||
|
@ -31,7 +32,8 @@ impl CmdUpload {
|
||||||
.alias("f")
|
.alias("f")
|
||||||
.value_name("NAME")
|
.value_name("NAME")
|
||||||
.help("Rename the file being uploaded"),
|
.help("Rename the file being uploaded"),
|
||||||
).arg(
|
)
|
||||||
|
.arg(
|
||||||
Arg::with_name("open")
|
Arg::with_name("open")
|
||||||
.long("open")
|
.long("open")
|
||||||
.short("o")
|
.short("o")
|
||||||
|
|
|
@ -55,7 +55,8 @@ pub fn print_error<E: Fail>(err: impl Borrow<E>) {
|
||||||
} else {
|
} else {
|
||||||
eprintln!("{} {}", highlight_error("caused by:"), err);
|
eprintln!("{} {}", highlight_error("caused by:"), err);
|
||||||
}
|
}
|
||||||
}).count();
|
})
|
||||||
|
.count();
|
||||||
|
|
||||||
// Fall back to a basic message
|
// Fall back to a basic message
|
||||||
if count == 0 {
|
if count == 0 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue