summaryrefslogtreecommitdiffstats
path: root/src/args.rs
diff options
context:
space:
mode:
authorextrawurst <mail@rusticorn.com>2022-12-10 01:57:04 +0100
committerextrawurst <mail@rusticorn.com>2022-12-10 01:57:04 +0100
commite8b709784594dc61d86e42349b82ac1d504aab50 (patch)
treef0e050b94847b80db466e9f765c8ac88c0958bfb /src/args.rs
parentfa302717e88c7e3c2b1ef280f082d6eaf516ad9a (diff)
fix regular app exectuation after 045e9e5
Diffstat (limited to 'src/args.rs')
-rw-r--r--src/args.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/args.rs b/src/args.rs
index 28cb81ec..f67f8158 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -2,8 +2,8 @@ use crate::bug_report;
use anyhow::{anyhow, Result};
use asyncgit::sync::RepoPath;
use clap::{
- crate_authors, crate_description, crate_name, crate_version,
- value_parser, Arg, Command as ClapApp,
+ crate_authors, crate_description, crate_name, crate_version, Arg,
+ Command as ClapApp,
};
use simplelog::{Config, LevelFilter, WriteLogger};
use std::{
@@ -22,11 +22,12 @@ pub fn process_cmdline() -> Result<CliArgs> {
let app = app();
let arg_matches = app.get_matches();
- if arg_matches.contains_id("bugreport") {
+
+ if arg_matches.get_flag("bugreport") {
bug_report::generate_bugreport();
std::process::exit(0);
}
- if arg_matches.contains_id("logging") {
+ if arg_matches.get_flag("logging") {
setup_logging()?;
}
@@ -98,14 +99,13 @@ fn app() -> ClapApp {
Arg::new("poll")
.help("Poll folder for changes instead of using file system events. This can be useful if you run into issues with maximum # of file descriptors")
.long("polling")
- .num_args(0)
- .value_parser(value_parser!(bool)),
+ .action(clap::ArgAction::SetTrue),
)
.arg(
Arg::new("bugreport")
.help("Generate a bug report")
.long("bugreport")
- .num_args(0),
+ .action(clap::ArgAction::SetTrue),
)
.arg(
Arg::new("directory")