-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Prover CLI Scaffoldings (#1609)
## What ❔ This PR implements the scaffolding for a CLI to interact with the prover. Additionally, it integrates the functionality of the `tool` crate. ## Why ❔ The purpose of this CLI is to simplify the process of interacting with the prover and enhance its usability. Users can easily interact with the prover without requiring specialized insider knowledge, ensuring that it can managed without direct database access and complex manual queries. ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`. - [ ] Spellcheck has been run via `zk spellcheck`. - [ ] Linkcheck has been run via `zk linkcheck`. --------- Co-authored-by: Lech <88630083+Artemka374@users.noreply.github.com> Co-authored-by: Ivan Litteri <67517699+ilitteri@users.noreply.github.com>
- Loading branch information
1 parent
932b14b
commit 9a22fa0
Showing
9 changed files
with
106 additions
and
57 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use clap::{command, Parser, Subcommand}; | ||
|
||
use crate::commands::get_file_info; | ||
|
||
pub const VERSION_STRING: &str = env!("CARGO_PKG_VERSION"); | ||
|
||
#[derive(Parser)] | ||
#[command(name="prover-cli", version=VERSION_STRING, about, long_about = None)] | ||
struct ProverCLI { | ||
#[command(subcommand)] | ||
command: ProverCommand, | ||
} | ||
|
||
#[derive(Subcommand)] | ||
enum ProverCommand { | ||
FileInfo(get_file_info::Args), | ||
} | ||
|
||
pub async fn start() -> anyhow::Result<()> { | ||
let ProverCLI { command } = ProverCLI::parse(); | ||
match command { | ||
ProverCommand::FileInfo(args) => get_file_info::run(args).await?, | ||
}; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub(crate) mod get_file_info; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod cli; | ||
mod commands; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use prover_cli::cli; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
env_logger::builder() | ||
.filter_level(log::LevelFilter::Debug) | ||
.init(); | ||
|
||
cli::start().await.unwrap(); | ||
} |