cli: Minor cleanups

This commit is contained in:
Alexis Sellier 2023-01-23 18:14:32 +01:00
parent fea14ff7b3
commit fd5ac7f6af
No known key found for this signature in database
2 changed files with 7 additions and 7 deletions

View File

@ -11,7 +11,7 @@ use radicle::prelude::*;
use radicle::rad; use radicle::rad;
use radicle::storage::WriteStorage; use radicle::storage::WriteStorage;
use crate::commands::rad_checkout::setup_remotes; use crate::commands::rad_checkout as checkout;
use crate::project; use crate::project;
use crate::terminal as term; use crate::terminal as term;
use crate::terminal::args::{Args, Error, Help}; use crate::terminal::args::{Args, Error, Help};
@ -108,7 +108,7 @@ pub fn clone(id: Id, _interactive: Interactive, ctx: impl term::Context) -> anyh
let default_branch = proj.default_branch().clone(); let default_branch = proj.default_branch().clone();
// Setup tracking for project delegates. // Setup tracking for project delegates.
setup_remotes( checkout::setup_remotes(
project::SetupRemote { project::SetupRemote {
project: id, project: id,
default_branch, default_branch,

View File

@ -17,14 +17,14 @@ Usage
Options Options
--profile Show Profile ID --id Show ID
--help Show help --help Show help
"#, "#,
}; };
#[derive(Debug)] #[derive(Debug)]
enum Show { enum Show {
Profile, Id,
All, All,
} }
@ -42,8 +42,8 @@ impl Args for Options {
while let Some(arg) = parser.next()? { while let Some(arg) = parser.next()? {
match arg { match arg {
Long("profile") if show.is_none() => { Long("id") if show.is_none() => {
show = Some(Show::Profile); show = Some(Show::Id);
} }
Long("help") => { Long("help") => {
return Err(Error::Help.into()); return Err(Error::Help.into());
@ -65,7 +65,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
let profile = ctx.profile()?; let profile = ctx.profile()?;
match options.show { match options.show {
Show::Profile => { Show::Id => {
term::print(profile.id()); term::print(profile.id());
} }
Show::All => all(&profile)?, Show::All => all(&profile)?,