summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2020-02-15 22:46:43 +0100
committerCanop <cano.petrole@gmail.com>2020-02-15 22:46:43 +0100
commitc35fd8ea84a0f6c441afd4c66edb631de123f1ae (patch)
tree07384d595d3b4d01830108b7f71b72a74657d307
parentff115ed2406c1a77b163272c13069567db2f44fe (diff)
fix -i and -I launch arguments being ignored
fix #202 (there's a design problem in clap... using strings as keys isn't sound)
-rw-r--r--CHANGELOG.md3
-rw-r--r--Cargo.toml1
-rw-r--r--src/conf.rs3
-rw-r--r--src/keys.rs2
-rw-r--r--src/task_sync.rs6
-rw-r--r--src/tree_build/bid.rs4
-rw-r--r--src/tree_options.rs4
7 files changed, 13 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d683f75..4420f5a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+### master
+- fix -i and -I launch arguments being ignored (fix #202)
+
<a name="v0.13.1"></a>
### v0.13.1 - 2020-02-08
- fix background not always removed when skin requires no background (Fix #194)
diff --git a/Cargo.toml b/Cargo.toml
index 35893f2..e8adbf4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,7 +11,6 @@ license = "MIT"
categories = ["command-line-utilities"]
readme = "README.md"
build = "build.rs"
-rustc = "1.40"
[dependencies]
clap = "2.33"
diff --git a/src/conf.rs b/src/conf.rs
index 1d5733f..d7aa78d 100644
--- a/src/conf.rs
+++ b/src/conf.rs
@@ -186,7 +186,8 @@ const DEFAULT_CONF_FILE: &str = r#"
# You can set up flags you want broot to start with by
# default, for example `default_flags="ihp"` if you usually want
# to see hidden and gitignored files and the permissions (then
-# if you don't want the hidden files you can launch `br -H`
+# if you don't want the hidden files you can launch `br -H`)
+# A popular flag is the `g` one which displays git related info.
#
default_flags = ""
diff --git a/src/keys.rs b/src/keys.rs
index a975ecd..be3eeef 100644
--- a/src/keys.rs
+++ b/src/keys.rs
@@ -40,6 +40,7 @@ const_key!(HOME, Home);
const_key!(LEFT, Left);
const_key!(QUESTION, Char('?'));
const_key!(RIGHT, Right);
+const_key!(SPACE, Char(' '));
const_key!(TAB, Tab);
const_key!(UP, Up);
@@ -126,6 +127,7 @@ pub fn parse_key(raw: &str) -> Result<KeyEvent, ConfError> {
"f10" => F(10),
"f11" => F(11),
"f12" => F(12),
+ "space" => Char(' '),
c if c.len() == 1 => Char(c.chars().next().unwrap()),
_ => {
return bad_key(raw);
diff --git a/src/task_sync.rs b/src/task_sync.rs
index 48f4f8b..c78e039 100644
--- a/src/task_sync.rs
+++ b/src/task_sync.rs
@@ -38,7 +38,8 @@ impl<V> ComputationResult<V> {
}
}
-/// a dam is used in broot to manage long computations and,
+/// The dam controls the flow of events.
+/// A dam is used in broot to manage long computations and,
/// when the user presses a key, either tell the computation
/// to stop (the computation function checking `has_event`)
/// or drop the computation.
@@ -47,9 +48,6 @@ pub struct Dam {
in_dam: Option<Event>,
}
-// cache problem: we must receive the result of dropped
-// computattion to use it if we receive the same
-// computation key later
impl Dam {
pub fn from(receiver: Receiver<Event>) -> Self {
Self {
diff --git a/src/tree_build/bid.rs b/src/tree_build/bid.rs
index e053af9..a7fe3f9 100644
--- a/src/tree_build/bid.rs
+++ b/src/tree_build/bid.rs
@@ -1,7 +1,7 @@
use {
super::bline::BLine,
id_arena::Id,
- std::cmp::{self, Ordering},
+ std::cmp::Ordering,
};
pub type BId = Id<BLine>;
@@ -31,7 +31,7 @@ impl Ord for SortableBId {
}
}
impl PartialOrd for SortableBId {
- fn partial_cmp(&self, other: &SortableBId) -> Option<cmp::Ordering> {
+ fn partial_cmp(&self, other: &SortableBId) -> Option<Ordering> {
Some(self.cmp(other))
}
}
diff --git a/src/tree_options.rs b/src/tree_options.rs
index 28ac099..d3a5d83 100644
--- a/src/tree_options.rs
+++ b/src/tree_options.rs
@@ -66,9 +66,9 @@ impl TreeOptions {
} else if cli_args.is_present("no-permissions") {
self.show_permissions = false;
}
- if cli_args.is_present("show-git-ignored") {
+ if cli_args.is_present("show-gitignored") {
self.respect_git_ignore = false;
- } else if cli_args.is_present("no-show-git-ignored") {
+ } else if cli_args.is_present("no-show-gitignored") {
self.respect_git_ignore = true;
}
if cli_args.is_present("show-git-info") {