Skip to content

Commit

Permalink
Make a alias 'clone' for 'project clone'
Browse files Browse the repository at this point in the history
  • Loading branch information
eikek committed Jul 18, 2024
1 parent 9fc7d8d commit c347809
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pub mod cmd;
pub mod opts;
pub mod sink;

use self::cmd::project::Error as ProjectError;
use self::cmd::{CmdError, Context};
use self::opts::{MainOpts, SubCommand};
use clap::CommandFactory;
Expand All @@ -19,6 +20,10 @@ pub async fn execute_cmd(opts: MainOpts) -> Result<(), CmdError> {
input.print_completions(&mut app).await;
}
SubCommand::Project(input) => input.exec(ctx).await?,
SubCommand::Clone(input) => input
.exec(ctx)
.await
.map_err(|source| ProjectError::Clone { source })?,

#[cfg(feature = "user-doc")]
SubCommand::UserDoc(input) => input.exec(ctx).await?,
Expand Down
4 changes: 4 additions & 0 deletions src/cli/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ pub enum SubCommand {
#[command()]
Project(project::Input),

/// Clone a project. (Shortcut for 'project clone')
#[command()]
Clone(project::clone::Input),

#[cfg(feature = "user-doc")]
UserDoc(userdoc::Input),
}
Expand Down

0 comments on commit c347809

Please sign in to comment.