Skip to content

Commit

Permalink
Add no-op command for testing
Browse files Browse the repository at this point in the history
Only enabled in debug configuration.
  • Loading branch information
Sharparam committed Aug 15, 2023
1 parent b7e28d9 commit 8c42897
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ pub struct Cli {
pub enum Commands {
Portal(PortalArgs),
Completion(CompletionArgs),

/// Do nothing.
///
/// Used for debugging.
#[cfg(debug_assertions)]
#[command(name = "noop", visible_alias = "nop")]
NoOp,
}

impl Cli {
Expand Down
3 changes: 3 additions & 0 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ fn try_main() -> Result<()> {
match cli.command {
cli::Commands::Portal(portal) => portal.run(&api_client),
cli::Commands::Completion(completion) => completion.run(),

#[cfg(debug_assertions)]
cli::Commands::NoOp => Ok(()),
}
}

Expand Down

0 comments on commit 8c42897

Please sign in to comment.