Rename from new to init

This commit is contained in:
howardwu 2020-04-24 21:15:33 -07:00
parent 8c5be763ff
commit 93b47602dd
5 changed files with 17 additions and 17 deletions

View File

@ -13,15 +13,15 @@ use std::path::PathBuf;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
pub struct NewCommand {
pub struct InitCommand {
#[structopt(parse(from_os_str))]
path: PathBuf,
}
impl CLI for NewCommand {
impl CLI for InitCommand {
type Options = ();
const NAME: NameType = "new";
const NAME: NameType = "init";
const ABOUT: AboutType = "Creates a new Leo package (include -h for more options)";
const FLAGS: &'static [FlagType] = &[];
const OPTIONS: &'static [OptionType] = &[];

2
leo/commands/init/mod.rs Normal file
View File

@ -0,0 +1,2 @@
pub mod init;
pub use self::init::*;

View File

@ -2,5 +2,5 @@
pub mod cli;
pub mod cli_types;
pub mod new;
pub use self::new::*;
pub mod init;
pub use self::init::*;

View File

@ -1,2 +0,0 @@
pub mod new;
pub use self::new::*;

View File

@ -23,7 +23,7 @@
// }
//
// impl<F: Field + PrimeField> Benchmark<F> {
// pub fn new() -> Self {
// pub fn init() -> Self {
// Self {
// _engine: PhantomData,
// }
@ -56,16 +56,16 @@
// }
//
// fn main() {
// let mut setup = Duration::new(0, 0);
// let mut proving = Duration::new(0, 0);
// let mut verifying = Duration::new(0, 0);
// let mut setup = Duration::init(0, 0);
// let mut proving = Duration::init(0, 0);
// let mut verifying = Duration::init(0, 0);
//
// let rng = &mut thread_rng();
//
// let start = Instant::now();
//
// let params = {
// let circuit = Benchmark::<Fr>::new();
// let circuit = Benchmark::<Fr>::init();
// generate_random_parameters::<Bls12_377, _, _>(circuit, rng).unwrap()
// };
//
@ -75,7 +75,7 @@
//
// let start = Instant::now();
// let proof = {
// let c = Benchmark::new();
// let c = Benchmark::init();
// create_random_proof(c, &params, rng).unwrap()
// };
//
@ -99,7 +99,7 @@
// println!(" Verifier output : {}", is_success);
// println!(" ");
//
// // let mut cs = TestConstraintSystem::<Fr>::new();
// // let mut cs = TestConstraintSystem::<Fr>::init();
// //
// // println!("\n satisfied: {:?}", cs.is_satisfied());
// //
@ -110,7 +110,7 @@
// //
// }
use leo::commands::{cli::*, NewCommand};
use leo::commands::{cli::*, InitCommand};
use leo::errors::CLIError;
use clap::{App, AppSettings};
@ -128,14 +128,14 @@ fn main() -> Result<(), CLIError> {
AppSettings::SubcommandRequiredElseHelp,
])
.subcommands(vec![
NewCommand::new(),
InitCommand::new(),
])
.set_term_width(0)
.get_matches();
match arguments.subcommand() {
// ("new", Some(arguments)) => {
// ("init", Some(arguments)) => {
// NewCommand::().output(NewCommand::parse(arguments)?)
// },
_ => unreachable!(),