summaryrefslogtreecommitdiffstats
path: root/src/args.rs
diff options
context:
space:
mode:
authorChristoph Rüßler <christoph.ruessler@mailbox.org>2023-04-29 17:03:43 +0200
committerGitHub <noreply@github.com>2023-04-29 17:03:43 +0200
commit370aff5fcc316bf381c650942065c06ffb5eb76e (patch)
tree52c87b06cf65231a05dddc9039bb697d9ac8e3f5 /src/args.rs
parent836e03c01c9cadc07be0ce0ab7df097688ac34e1 (diff)
Default to tick-based updates (#1657)
* Default to tick-based updates This commit reintroduces code that was previously removed in favor of a notify-based update trigger. It turned out that notify-based updates can cause issues in larger repositories, so tick-based updates seemed like a safer default. https://github.com/extrawurst/gitui/issues/1444 https://github.com/extrawurst/gitui/pull/1310 * Add FAQ entry for --watcher * Remove --poll
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 9689164a..7dd3853c 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -15,7 +15,7 @@ use std::{
pub struct CliArgs {
pub theme: PathBuf,
pub repo_path: RepoPath,
- pub poll_watcher: bool,
+ pub notify_watcher: bool,
}
pub fn process_cmdline() -> Result<CliArgs> {
@@ -54,13 +54,13 @@ pub fn process_cmdline() -> Result<CliArgs> {
get_app_config_path()?.join("theme.ron")
};
- let arg_poll: bool =
- *arg_matches.get_one("poll").unwrap_or(&false);
+ let notify_watcher: bool =
+ *arg_matches.get_one("watcher").unwrap_or(&false);
Ok(CliArgs {
theme,
- poll_watcher: arg_poll,
repo_path,
+ notify_watcher,
})
}
@@ -96,9 +96,9 @@ fn app() -> ClapApp {
.num_args(0),
)
.arg(
- 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")
+ Arg::new("watcher")
+ .help("Use notify-based file system watcher instead of tick-based update. This is more performant, but can cause issues on some platforms. See https://github.com/extrawurst/gitui/blob/master/FAQ.md#watcher for details.")
+ .long("watcher")
.action(clap::ArgAction::SetTrue),
)
.arg(