Skip to content

Commit

Permalink
[Move CLI] Added disassemble and coverage command-line options (Myste…
Browse files Browse the repository at this point in the history
  • Loading branch information
awelc authored Jul 7, 2022
1 parent eccd13b commit 87dbe33
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
20 changes: 20 additions & 0 deletions crates/sui/src/sui_move/coverage.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

use clap::Parser;
use move_cli::base::coverage;
use move_package::BuildConfig;
use std::path::PathBuf;

#[derive(Parser)]
pub struct Coverage {
#[clap(flatten)]
pub coverage: coverage::Coverage,
}

impl Coverage {
pub fn execute(self, path: Option<PathBuf>, build_config: BuildConfig) -> anyhow::Result<()> {
self.coverage.execute(path, build_config)?;
Ok(())
}
}
20 changes: 20 additions & 0 deletions crates/sui/src/sui_move/disassemble.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

use clap::Parser;
use move_cli::base::disassemble;
use move_package::BuildConfig;
use std::path::PathBuf;

#[derive(Parser)]
pub struct Disassemble {
#[clap(flatten)]
pub disassemble: disassemble::Disassemble,
}

impl Disassemble {
pub fn execute(self, path: Option<PathBuf>, build_config: BuildConfig) -> anyhow::Result<()> {
self.disassemble.execute(path, build_config)?;
Ok(())
}
}
6 changes: 6 additions & 0 deletions crates/sui/src/sui_move/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ use move_unit_test::UnitTestingConfig;
use std::path::PathBuf;

pub mod build;
pub mod coverage;
pub mod disassemble;
pub mod new;
pub mod unit_test;

#[derive(Parser)]
pub enum Command {
Build(build::Build),
Coverage(coverage::Coverage),
Disassemble(disassemble::Disassemble),
New(new::New),
Test(unit_test::Test),
}
Expand All @@ -25,6 +29,8 @@ pub fn execute_move_command(
) -> anyhow::Result<()> {
match command {
Command::Build(c) => c.execute(package_path, build_config),
Command::Coverage(c) => c.execute(package_path, build_config),
Command::Disassemble(c) => c.execute(package_path, build_config),
Command::Test(c) => {
let unit_test_config = UnitTestingConfig {
instruction_execution_bound: c.test.instruction_execution_bound,
Expand Down

0 comments on commit 87dbe33

Please sign in to comment.