Skip to content

Commit

Permalink
Merge pull request #134 from siketyan/feat/rename-full-path-option
Browse files Browse the repository at this point in the history
feat: Rename --full-path to --path, adding a short alias -p
  • Loading branch information
siketyan authored Apr 23, 2023
2 parents 69f3d94 + 602c646 commit 7a9e171
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/cmd/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ pub struct Cmd {
#[clap(long)]
no_owner: bool,

/// Lists repositories as full paths.
#[clap(long)]
full_path: bool,
/// Lists repositories as full paths instead of their names.
#[clap(short, long)]
path: bool,
}

impl Cmd {
Expand All @@ -27,10 +27,8 @@ impl Cmd {

Repositories::try_collect(&root)?
.into_iter()
.map(|(path, _)| match self {
Cmd {
full_path: true, ..
} => PathBuf::from(path).to_string_lossy().to_string(),
.map(|(path, _)| match self.path {
true => PathBuf::from(path).to_string_lossy().to_string(),
_ => path.to_string_with(!self.no_host, !self.no_owner),
})
.sorted()
Expand Down

0 comments on commit 7a9e171

Please sign in to comment.