mirror of
https://github.com/timvisee/ffsend.git
synced 2025-10-03 17:49:15 +02:00
Disable clap colors if no-color feature is used
This commit is contained in:
parent
19657fbfaa
commit
f1f0b20f5d
1 changed files with 9 additions and 2 deletions
|
@ -29,7 +29,8 @@ pub struct Handler<'a> {
|
||||||
impl<'a: 'b, 'b> Handler<'a> {
|
impl<'a: 'b, 'b> Handler<'a> {
|
||||||
/// Build the application CLI definition.
|
/// Build the application CLI definition.
|
||||||
pub fn build() -> App<'a, 'b> {
|
pub fn build() -> App<'a, 'b> {
|
||||||
App::new(crate_name!())
|
// Build the CLI application definition
|
||||||
|
let app = App::new(crate_name!())
|
||||||
.version(crate_version!())
|
.version(crate_version!())
|
||||||
.author(crate_authors!())
|
.author(crate_authors!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
|
@ -59,7 +60,13 @@ impl<'a: 'b, 'b> Handler<'a> {
|
||||||
.subcommand(CmdInfo::build())
|
.subcommand(CmdInfo::build())
|
||||||
.subcommand(CmdParams::build())
|
.subcommand(CmdParams::build())
|
||||||
.subcommand(CmdPassword::build())
|
.subcommand(CmdPassword::build())
|
||||||
.subcommand(CmdUpload::build().display_order(1))
|
.subcommand(CmdUpload::build().display_order(1));
|
||||||
|
|
||||||
|
// Disable color usage if compiled without color support
|
||||||
|
#[cfg(feature = "no-color")]
|
||||||
|
let app = app.global_setting(AppSettings::ColorNever);
|
||||||
|
|
||||||
|
app
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse CLI arguments.
|
/// Parse CLI arguments.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue