multiversx_sc_meta/cli/
cli_standalone_main.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
use crate::cli::{StandaloneCliAction, StandaloneCliArgs};
use crate::cmd::chain_simulator::chain_simulator;
use crate::cmd::retrieve_address::retrieve_address;
use crate::cmd::wallet::wallet;
use clap::Parser;

use crate::cmd::all::call_all_meta;
use crate::cmd::code_report::report;
use crate::cmd::info::call_info;
use crate::cmd::install::install;
use crate::cmd::local_deps::local_deps;
use crate::cmd::scen_test_gen::test_gen_tool;
use crate::cmd::template::{create_contract, print_template_names};
use crate::cmd::test::test;
use crate::cmd::test_coverage::test_coverage;

use crate::cmd::upgrade::upgrade_sc;

/// Entry point in the program when calling it as a standalone tool.
pub async fn cli_main_standalone() {
    let cli_args = StandaloneCliArgs::parse();
    match &cli_args.command {
        Some(StandaloneCliAction::Info(args)) => call_info(args),
        Some(StandaloneCliAction::Install(args)) => install(args).await,
        Some(StandaloneCliAction::All(args)) => call_all_meta(args),
        Some(StandaloneCliAction::Upgrade(args)) => {
            upgrade_sc(args);
        },
        Some(StandaloneCliAction::Template(args)) => {
            create_contract(args).await;
        },
        Some(StandaloneCliAction::TemplateList(args)) => {
            print_template_names(args).await;
        },
        Some(StandaloneCliAction::TestGen(args)) => {
            test_gen_tool(args);
        },
        Some(StandaloneCliAction::Test(args)) => test(args),
        Some(StandaloneCliAction::TestCoverage(args)) => {
            test_coverage(args);
        },
        Some(StandaloneCliAction::CodeReportGen(args)) => {
            report(args);
        },
        Some(StandaloneCliAction::Account(args)) => {
            retrieve_address(args).await;
        },
        Some(StandaloneCliAction::LocalDeps(args)) => {
            local_deps(args);
        },
        Some(StandaloneCliAction::Wallet(args)) => {
            wallet(args);
        },
        Some(StandaloneCliAction::ChainSimulator(args)) => {
            chain_simulator(args);
        },
        None => {},
    }
}