Skip to content

Commit

Permalink
cli: rename --verbose to --debug to better fit what it does
Browse files Browse the repository at this point in the history
  • Loading branch information
poliorcetics committed Feb 18, 2024
1 parent 06d67f0 commit 109ba3c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* `jj git fetch` now automatically prints new remote branches and tags by default.

* `--verbose/-v` is now `--debug` (no short option since it's not intended to be used often)

### Fixed bugs

* On Windows, symlinks in the repo are now materialized as regular files in the
Expand Down
12 changes: 6 additions & 6 deletions cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ impl TracingSubscription {
}
}

pub fn enable_verbose_logging(&self) -> Result<(), CommandError> {
pub fn enable_debug_logging(&self) -> Result<(), CommandError> {
self.reload_log_filter
.modify(|filter| {
*filter = tracing_subscriber::EnvFilter::builder()
Expand Down Expand Up @@ -2497,9 +2497,9 @@ pub struct GlobalArgs {
/// do that, but it is possible.
#[arg(long, visible_alias = "at-op", global = true, default_value = "@")]
pub at_operation: String,
/// Enable verbose logging
#[arg(long, short = 'v', global = true)]
pub verbose: bool,
/// Enable debug logging
#[arg(long, global = true)]
pub debug: bool,

#[command(flatten)]
pub early_args: EarlyArgs,
Expand Down Expand Up @@ -2743,9 +2743,9 @@ pub fn parse_args(
.try_get_matches_from(string_args)?;

let args: Args = Args::from_arg_matches(&matches).unwrap();
if args.global_args.verbose {
if args.global_args.debug {
// TODO: set up verbose logging as early as possible
tracing_subscription.enable_verbose_logging()?;
tracing_subscription.enable_debug_logging()?;
}

Ok((matches, args))
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ repository.
* `--at-operation <AT_OPERATION>` — Operation to load the repo at
Default value: `@`
* `-v`, `--verbose` — Enable verbose logging
* `--debug` — Enable debug logging
Possible values: `true`, `false`
Expand Down

0 comments on commit 109ba3c

Please sign in to comment.