cli: Minor cleanups
This commit is contained in:
parent
fea14ff7b3
commit
fd5ac7f6af
|
|
@ -11,7 +11,7 @@ use radicle::prelude::*;
|
|||
use radicle::rad;
|
||||
use radicle::storage::WriteStorage;
|
||||
|
||||
use crate::commands::rad_checkout::setup_remotes;
|
||||
use crate::commands::rad_checkout as checkout;
|
||||
use crate::project;
|
||||
use crate::terminal as term;
|
||||
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();
|
||||
|
||||
// Setup tracking for project delegates.
|
||||
setup_remotes(
|
||||
checkout::setup_remotes(
|
||||
project::SetupRemote {
|
||||
project: id,
|
||||
default_branch,
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@ Usage
|
|||
|
||||
Options
|
||||
|
||||
--profile Show Profile ID
|
||||
--id Show ID
|
||||
--help Show help
|
||||
"#,
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
enum Show {
|
||||
Profile,
|
||||
Id,
|
||||
All,
|
||||
}
|
||||
|
||||
|
|
@ -42,8 +42,8 @@ impl Args for Options {
|
|||
|
||||
while let Some(arg) = parser.next()? {
|
||||
match arg {
|
||||
Long("profile") if show.is_none() => {
|
||||
show = Some(Show::Profile);
|
||||
Long("id") if show.is_none() => {
|
||||
show = Some(Show::Id);
|
||||
}
|
||||
Long("help") => {
|
||||
return Err(Error::Help.into());
|
||||
|
|
@ -65,7 +65,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
|
|||
let profile = ctx.profile()?;
|
||||
|
||||
match options.show {
|
||||
Show::Profile => {
|
||||
Show::Id => {
|
||||
term::print(profile.id());
|
||||
}
|
||||
Show::All => all(&profile)?,
|
||||
|
|
|
|||
Loading…
Reference in New Issue