Skip to main content

blackbox_generator/
opt.rs

1use anyhow::Result;
2use std::{env, path::PathBuf};
3use structopt::StructOpt;
4
5pub fn get_input() -> Result<(Opt, PathBuf)>{
6    let option = Opt::from_args();
7    let path = env::current_dir()?;
8
9    Ok((option, path))
10}
11
12#[derive(Debug, StructOpt)]
13#[structopt(name = "BlackBox-Generator", about = "The fastest and simplest NFT Generator for Solana/Ethereum")]
14pub struct Opt {
15    #[structopt(subcommand)]
16    pub command: Command,
17}
18
19#[derive(Debug, StructOpt)]
20pub enum Command {
21    /// Creates a new working folder in the current directory.
22    #[structopt(name = "init")]
23    Init { 
24        #[structopt(subcommand)]
25        init_subcommands: InitSubcommands,
26    },
27
28    /// Verify if the provided assets follows the required standards.
29    #[structopt(name = "verify")]
30    Verify {},
31
32    /// Starts the UI configuration process.
33    #[structopt(name = "config")]
34    Config {},
35
36    /// Edit the actual configuration.
37    #[structopt(name = "edit")]
38    Edit {},
39
40    /// Generate a collection following the configuration.
41    #[structopt(name = "generate")]
42    Generate {},
43
44    /// Calculates the Rarity ranking of an already created NFT Colelction
45    #[structopt(name = "rarity")]
46    Rarity {},
47}
48
49#[derive(Debug, StructOpt)]
50pub enum InitSubcommands {
51    /// Initialize working folder with name *<name>* for Solana Blockchain  
52    #[structopt(name = "solana")]
53    Solana {
54        /// Name of the working folder
55        #[structopt(short, long)]
56        name: String,
57    },
58    /// Initialize working folder with name *<name>* for Ethereum Blockchain  
59    #[structopt(name = "ethereum")]
60    Ethereum {
61        /// Name of the working folder
62        #[structopt(short, long)]
63        name: String,
64    },
65}
66