Skip to content

Commit

Permalink
cli: use RevisionArg type in "resolve -r" and example command
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Apr 3, 2024
1 parent 8b73d7a commit 056b917
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cli/examples/custom-command/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use std::io::Write as _;

use jj_cli::cli_util::{CliRunner, CommandHelper};
use jj_cli::cli_util::{CliRunner, CommandHelper, RevisionArg};
use jj_cli::command_error::CommandError;
use jj_cli::ui::Ui;

Expand All @@ -28,7 +28,7 @@ enum CustomCommand {
struct FrobnicateArgs {
/// The revision to frobnicate
#[arg(default_value = "@")]
revision: String,
revision: RevisionArg,
}

fn run_custom_command(
Expand Down
4 changes: 2 additions & 2 deletions cli/src/commands/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use jj_lib::object_id::ObjectId;
use jj_lib::repo_path::RepoPathBuf;
use tracing::instrument;

use crate::cli_util::{CommandHelper, WorkspaceCommandHelper};
use crate::cli_util::{CommandHelper, RevisionArg, WorkspaceCommandHelper};
use crate::command_error::{cli_error, CommandError};
use crate::formatter::Formatter;
use crate::ui::Ui;
Expand All @@ -45,7 +45,7 @@ use crate::ui::Ui;
#[derive(clap::Args, Clone, Debug)]
pub(crate) struct ResolveArgs {
#[arg(long, short, default_value = "@")]
revision: String,
revision: RevisionArg,
/// Instead of resolving one conflict, list all the conflicts
// TODO: Also have a `--summary` option. `--list` currently acts like
// `diff --summary`, but should be more verbose.
Expand Down

0 comments on commit 056b917

Please sign in to comment.