From 773cf190ee21381d826ba80391a5d7d5efae9174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Garc=C3=ADa?= Date: Wed, 13 Mar 2024 10:00:17 -0500 Subject: [PATCH] feat: Visible aliases for nargo commands (#4453) # Description Closes #4452 ## Documentation\ Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --- tooling/nargo_cli/src/cli/check_cmd.rs | 1 + tooling/nargo_cli/src/cli/execute_cmd.rs | 1 + tooling/nargo_cli/src/cli/info_cmd.rs | 1 + tooling/nargo_cli/src/cli/prove_cmd.rs | 1 + tooling/nargo_cli/src/cli/test_cmd.rs | 1 + tooling/nargo_cli/src/cli/verify_cmd.rs | 1 + 6 files changed, 6 insertions(+) diff --git a/tooling/nargo_cli/src/cli/check_cmd.rs b/tooling/nargo_cli/src/cli/check_cmd.rs index 242a640e484..897073f4e20 100644 --- a/tooling/nargo_cli/src/cli/check_cmd.rs +++ b/tooling/nargo_cli/src/cli/check_cmd.rs @@ -24,6 +24,7 @@ use super::NargoConfig; /// Checks the constraint system for errors #[derive(Debug, Clone, Args)] +#[clap(visible_alias = "c")] pub(crate) struct CheckCommand { /// The name of the package to check #[clap(long, conflicts_with = "workspace")] diff --git a/tooling/nargo_cli/src/cli/execute_cmd.rs b/tooling/nargo_cli/src/cli/execute_cmd.rs index 85c0a4160a7..1be2fbf61d9 100644 --- a/tooling/nargo_cli/src/cli/execute_cmd.rs +++ b/tooling/nargo_cli/src/cli/execute_cmd.rs @@ -23,6 +23,7 @@ use crate::errors::CliError; /// Executes a circuit to calculate its return value #[derive(Debug, Clone, Args)] +#[clap(visible_alias = "e")] pub(crate) struct ExecuteCommand { /// Write the execution witness to named file witness_name: Option, diff --git a/tooling/nargo_cli/src/cli/info_cmd.rs b/tooling/nargo_cli/src/cli/info_cmd.rs index 300e1a35be2..391e8061a07 100644 --- a/tooling/nargo_cli/src/cli/info_cmd.rs +++ b/tooling/nargo_cli/src/cli/info_cmd.rs @@ -30,6 +30,7 @@ use super::{compile_cmd::compile_workspace, NargoConfig}; /// 1. The number of ACIR opcodes /// 2. Counts the final number gates in the circuit used by a backend #[derive(Debug, Clone, Args)] +#[clap(visible_alias = "i")] pub(crate) struct InfoCommand { /// The name of the package to detail #[clap(long, conflicts_with = "workspace")] diff --git a/tooling/nargo_cli/src/cli/prove_cmd.rs b/tooling/nargo_cli/src/cli/prove_cmd.rs index f0a9b3185b9..e413db0e5f3 100644 --- a/tooling/nargo_cli/src/cli/prove_cmd.rs +++ b/tooling/nargo_cli/src/cli/prove_cmd.rs @@ -20,6 +20,7 @@ use crate::{backends::Backend, cli::execute_cmd::execute_program, errors::CliErr /// Create proof for this program. The proof is returned as a hex encoded string. #[derive(Debug, Clone, Args)] +#[clap(visible_alias = "p")] pub(crate) struct ProveCommand { /// The name of the toml file which contains the inputs for the prover #[clap(long, short, default_value = PROVER_INPUT_FILE)] diff --git a/tooling/nargo_cli/src/cli/test_cmd.rs b/tooling/nargo_cli/src/cli/test_cmd.rs index 2828aaf01eb..88a804d5cf4 100644 --- a/tooling/nargo_cli/src/cli/test_cmd.rs +++ b/tooling/nargo_cli/src/cli/test_cmd.rs @@ -25,6 +25,7 @@ use super::NargoConfig; /// Run the tests for this program #[derive(Debug, Clone, Args)] +#[clap(visible_alias = "t")] pub(crate) struct TestCommand { /// If given, only tests with names containing this string will be run test_name: Option, diff --git a/tooling/nargo_cli/src/cli/verify_cmd.rs b/tooling/nargo_cli/src/cli/verify_cmd.rs index 1063b50ab6c..3e23c9a3e9f 100644 --- a/tooling/nargo_cli/src/cli/verify_cmd.rs +++ b/tooling/nargo_cli/src/cli/verify_cmd.rs @@ -17,6 +17,7 @@ use noirc_frontend::graph::CrateName; /// Given a proof and a program, verify whether the proof is valid #[derive(Debug, Clone, Args)] +#[clap(visible_alias = "v")] pub(crate) struct VerifyCommand { /// The name of the toml file which contains the inputs for the verifier #[clap(long, short, default_value = VERIFIER_INPUT_FILE)]