Skip to content

Commit

Permalink
Highlight echoed recipe lines in bold by default (#512)
Browse files Browse the repository at this point in the history
Make `--highlight`, which highlights echoed recipe lines in bold, the
default behavior. Add `--no-highlight` to activate the old behavior.
  • Loading branch information
casey authored Nov 7, 2019
1 parent 36aca2b commit 2ff33de
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ mod arg {
pub(crate) const COLOR: &str = "COLOR";
pub(crate) const DRY_RUN: &str = "DRY-RUN";
pub(crate) const HIGHLIGHT: &str = "HIGHLIGHT";
pub(crate) const NO_HIGHLIGHT: &str = "NO-HIGHLIGHT";
pub(crate) const JUSTFILE: &str = "JUSTFILE";
pub(crate) const QUIET: &str = "QUIET";
pub(crate) const SET: &str = "SET";
Expand Down Expand Up @@ -91,7 +92,14 @@ impl<'a> Config<'a> {
.arg(
Arg::with_name(arg::HIGHLIGHT)
.long("highlight")
.help("Highlight echoed recipe lines in bold"),
.help("Highlight echoed recipe lines in bold")
.overrides_with(arg::NO_HIGHLIGHT),
)
.arg(
Arg::with_name(arg::NO_HIGHLIGHT)
.long("no-highlight")
.help("Don't highlight echoed recipe lines in bold")
.overrides_with(arg::HIGHLIGHT),
)
.arg(
Arg::with_name(arg::JUSTFILE)
Expand Down Expand Up @@ -287,7 +295,7 @@ impl<'a> Config<'a> {

Ok(Config {
dry_run: matches.is_present(arg::DRY_RUN),
highlight: matches.is_present(arg::HIGHLIGHT),
highlight: !matches.is_present(arg::NO_HIGHLIGHT),
quiet: matches.is_present(arg::QUIET),
shell: matches.value_of(arg::SHELL).unwrap(),
justfile: matches.value_of(arg::JUSTFILE).map(Path::new),
Expand Down Expand Up @@ -340,15 +348,16 @@ USAGE:
just [FLAGS] [OPTIONS] [--] [ARGUMENTS]...
FLAGS:
--dry-run Print what just would do without doing it
--dump Print entire justfile
-e, --edit Open justfile with $EDITOR
--evaluate Print evaluated variables
--highlight Highlight echoed recipe lines in bold
-l, --list List available recipes and their arguments
-q, --quiet Suppress all output
--summary List names of available recipes
-v, --verbose Use verbose output
--dry-run Print what just would do without doing it
--dump Print entire justfile
-e, --edit Open justfile with $EDITOR
--evaluate Print evaluated variables
--highlight Highlight echoed recipe lines in bold
-l, --list List available recipes and their arguments
--no-highlight Don't highlight echoed recipe lines in bold
-q, --quiet Suppress all output
--summary List names of available recipes
-v, --verbose Use verbose output
OPTIONS:
--color <COLOR>
Expand Down

0 comments on commit 2ff33de

Please sign in to comment.