mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 10:41:57 +03:00
Merge pull request #13 from AleoHQ/skeleton/cli
Adds skeleton CLI for `leo publish`
This commit is contained in:
commit
730b3f8c58
@ -10,6 +10,9 @@ pub use self::new::*;
|
||||
pub mod prove;
|
||||
pub use self::prove::*;
|
||||
|
||||
pub mod publish;
|
||||
pub use self::publish::*;
|
||||
|
||||
pub mod run;
|
||||
pub use self::run::*;
|
||||
|
||||
|
41
leo/commands/publish.rs
Normal file
41
leo/commands/publish.rs
Normal file
@ -0,0 +1,41 @@
|
||||
use crate::{cli::*, cli_types::*};
|
||||
use crate::commands::BuildCommand;
|
||||
use crate::errors::CLIError;
|
||||
use crate::files::Manifest;
|
||||
|
||||
use clap::ArgMatches;
|
||||
use std::convert::TryFrom;
|
||||
use std::env::current_dir;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PublishCommand;
|
||||
|
||||
impl CLI for PublishCommand {
|
||||
type Options = ();
|
||||
type Output = ();
|
||||
|
||||
const NAME: NameType = "publish";
|
||||
const ABOUT: AboutType = "Package circuit and upload this package to the registry";
|
||||
const ARGUMENTS: &'static [ArgumentType] = &[];
|
||||
const FLAGS: &'static [FlagType] = &[];
|
||||
const OPTIONS: &'static [OptionType] = &[];
|
||||
const SUBCOMMANDS: &'static [SubCommandType] = &[];
|
||||
|
||||
#[cfg_attr(tarpaulin, skip)]
|
||||
fn parse(_arguments: &ArgMatches) -> Result<Self::Options, CLIError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg_attr(tarpaulin, skip)]
|
||||
fn output(options: Self::Options) -> Result<Self::Output, CLIError> {
|
||||
let (_program, _checksum_differs) = BuildCommand::output(options)?;
|
||||
|
||||
// Get the package name
|
||||
let path = current_dir()?;
|
||||
let _package_name = Manifest::try_from(&path)?.get_package_name();
|
||||
|
||||
log::info!("Unimplemented - `leo publish`");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
@ -25,6 +25,7 @@ fn main() -> Result<(), CLIError> {
|
||||
SetupCommand::new(),
|
||||
ProveCommand::new(),
|
||||
RunCommand::new(),
|
||||
PublishCommand::new(),
|
||||
])
|
||||
.set_term_width(0)
|
||||
.get_matches();
|
||||
@ -45,6 +46,7 @@ fn main() -> Result<(), CLIError> {
|
||||
Ok(())
|
||||
}
|
||||
("run", Some(arguments)) => RunCommand::output(RunCommand::parse(arguments)?),
|
||||
("publish", Some(arguments)) => PublishCommand::output(PublishCommand::parse(arguments)?),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user