diff --git a/Cargo.toml b/Cargo.toml index 6d90ba4..be45743 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,9 @@ exclude = [".idea/", "Cross.toml", "*.sh", "*.py", ".drone.yml"] #resolver = "2" #license-file = "LICENSE" +[badges] +maintenance = { status = "experimental" } + [features] default = ["multi-threaded"] multi-threaded = ["rayon"] diff --git a/src/parameters.rs b/src/parameters.rs index c43f319..12779d3 100644 --- a/src/parameters.rs +++ b/src/parameters.rs @@ -3,19 +3,31 @@ use std::path::PathBuf; use crate::extension_set::ExtensionSet; -use clap::{Clap}; +use clap::{Clap, AppSettings}; use smartstring::{LazyCompact, SmartString}; #[derive(Clap, PartialEq, Debug)] pub enum OutputFormat { + /// A Bourne shell compatible script. Script, + /// Plain text. Text, } // TODO: convert this to macro style?: https://docs.rs/clap/3.0.0-beta.2/clap/index.html#using-macros #[derive(Clap, Debug)] -#[clap(version = option_env!("CARGO_PKG_VERSION").unwrap_or("???"))] +#[clap( + version = option_env!("CARGO_PKG_VERSION").unwrap_or("???"), + author = option_env!("CARGO_PKG_AUTHORS").unwrap_or("Lynnesbian"), + about = option_env!("CARGO_PKG_DESCRIPTION").unwrap_or("File Info Fixer"), + before_help = "Copyright © 2021 Lynnesbian under the GPL3 (or later) License.", + before_long_help = "Copyright © 2021 Lynnesbian\n\ + This program is free software: you can redistribute it and/or modify \ + it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 \ + of the License, or (at your option) any later version.", + setting(AppSettings::ColoredHelp) +)] pub struct Parameters { /// Only examine files with these extensions (Comma-separated list) #[clap( @@ -35,7 +47,7 @@ pub struct Parameters { #[clap(short, long)] pub scan_hidden: bool, - /// Output format to use. See "--help formats" for more information. + /// Output format to use #[clap(short, long, default_value = "script", arg_enum)] pub output_format: OutputFormat, diff --git a/src/scan_error.rs b/src/scan_error.rs index bec5066..de26b29 100644 --- a/src/scan_error.rs +++ b/src/scan_error.rs @@ -19,7 +19,7 @@ impl Display for ScanError { Self::Mime(_) => "determine mime type of", }, match self { - Self::File(f) | Self::Mime(f) => f.to_string_lossy() + Self::File(f) | Self::Mime(f) => f.to_string_lossy(), } ) }