diff --git a/leo/cli/cli.rs b/leo/cli/cli.rs index 0679349e0c..fd743a5c90 100644 --- a/leo/cli/cli.rs +++ b/leo/cli/cli.rs @@ -39,7 +39,7 @@ pub struct CLI { pub home: Option, } -///Leo compiler and package manager +///The Leo CLI commands #[derive(Parser, Debug)] enum Commands { #[clap(about = "Create a new Aleo account, sign and verify messages")] @@ -47,7 +47,7 @@ enum Commands { #[clap(subcommand)] command: Account, }, - #[clap(about = "Create a new Leo package in a new directory")] + #[clap(about = "Create a new Leo project in a new directory")] New { #[clap(flatten)] command: New, @@ -57,6 +57,11 @@ enum Commands { #[clap(flatten)] command: Example, }, + #[clap(about = "Format the current Leo project", name = "fmt")] + Format { + #[clap(flatten)] + command: Format, + }, #[clap(about = "Run a program with input variables")] Run { #[clap(flatten)] @@ -77,17 +82,17 @@ enum Commands { #[clap(flatten)] command: Query, }, - #[clap(about = "Compile the current package as a program")] + #[clap(about = "Compile the current project")] Build { #[clap(flatten)] command: Build, }, - #[clap(about = "Add a new on-chain or local dependency to the current package.")] + #[clap(about = "Add a new on-chain or local dependency to the current project.")] Add { #[clap(flatten)] command: Add, }, - #[clap(about = "Remove a dependency from the current package.")] + #[clap(about = "Remove a dependency from the current project.")] Remove { #[clap(flatten)] command: Remove, @@ -137,6 +142,7 @@ pub fn run_with_args(cli: CLI) -> Result<()> { Commands::Clean { command } => command.try_execute(context), Commands::Deploy { command } => command.try_execute(context), Commands::Example { command } => command.try_execute(context), + Commands::Format { command } => command.try_execute(context), Commands::Run { command } => command.try_execute(context), Commands::Execute { command } => command.try_execute(context), Commands::Remove { command } => command.try_execute(context), diff --git a/leo/cli/commands/format.rs b/leo/cli/commands/format.rs new file mode 100644 index 0000000000..0a8c1b3fcc --- /dev/null +++ b/leo/cli/commands/format.rs @@ -0,0 +1,38 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the Leo library. + +// The Leo library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The Leo library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with the Leo library. If not, see . + +use super::*; + +/// Clean outputs folder command +#[derive(Parser, Debug)] +pub struct Format {} + +impl Command for Format { + type Input = (); + type Output = (); + + fn log_span(&self) -> Span { + tracing::span!(tracing::Level::INFO, "Leo") + } + + fn prelude(&self, _: Context) -> Result { + Ok(()) + } + + fn apply(self, _: Context, _: Self::Input) -> Result { + todo!() + } +} diff --git a/leo/cli/commands/mod.rs b/leo/cli/commands/mod.rs index 024e1ade26..6ba77110be 100644 --- a/leo/cli/commands/mod.rs +++ b/leo/cli/commands/mod.rs @@ -35,6 +35,9 @@ pub use example::Example; pub mod execute; pub use execute::Execute; +pub mod format; +pub use format::Format; + pub mod query; pub use query::Query;