mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-17 21:37:55 +08:00
refactor man and completion with clap derive api
This commit is contained in:
Vendored
+11
-6
@@ -6,19 +6,24 @@ const ARG_DISABLE_CACHE: &str = "disable-cache";
|
||||
|
||||
/// Represents the disable cache flag argument. This argument allows
|
||||
/// the user to disable any sort of cache.
|
||||
pub fn arg() -> Arg {
|
||||
Arg::new(ARG_DISABLE_CACHE)
|
||||
pub fn global_args() -> impl IntoIterator<Item = Arg> {
|
||||
[Arg::new(ARG_DISABLE_CACHE)
|
||||
.help("Disable any sort of cache")
|
||||
.long_help(
|
||||
"Disable any sort of cache. The action depends on
|
||||
the command it applies on.",
|
||||
"Disable any sort of cache.
|
||||
|
||||
The action depends on commands it apply on. For example, when listing
|
||||
envelopes using the IMAP backend, this flag will ensure that envelopes
|
||||
are fetched from the IMAP server and not from the synchronized local
|
||||
Maildir.",
|
||||
)
|
||||
.long("disable-cache")
|
||||
.alias("no-cache")
|
||||
.global(true)
|
||||
.action(ArgAction::SetTrue)
|
||||
.action(ArgAction::SetTrue)]
|
||||
}
|
||||
|
||||
/// Represents the disable cache flag parser.
|
||||
pub fn parse_disable_cache_flag(m: &ArgMatches) -> bool {
|
||||
pub fn parse_disable_cache_arg(m: &ArgMatches) -> bool {
|
||||
m.get_flag(ARG_DISABLE_CACHE)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user