Skip to content

Commit

Permalink
Switched to clap 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ecton committed Jan 1, 2022
1 parent 28d538b commit 37600ef
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion khonsu-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ publish = false
khonsu-universal-tools = { path = "../khonsu-universal-tools" }
devx-cmd = "0.5"
devx-pre-commit = "0.5"
structopt = "0.3"
clap = { version = "3", features = ["derive"] }
badge = "0.3"
anyhow = "1"
serde_json = "1"
Expand Down
14 changes: 7 additions & 7 deletions khonsu-tools/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
pub use khonsu_universal_tools as universal;

use structopt::StructOpt;
use clap::Parser;
use universal::DefaultConfig;

pub mod publish;

#[derive(StructOpt, Debug)]
#[derive(Parser, Debug)]
pub enum Commands {
Readmes {
#[structopt(long)]
#[clap(long)]
release: bool,
},
Publish {
#[structopt(long)]
#[clap(long)]
dry_run: bool,
#[structopt(long)]
#[clap(long)]
allow_dirty: bool,
},
#[structopt(flatten)]
#[clap(flatten)]
Universal(universal::Commands),
}

Expand All @@ -35,7 +35,7 @@ impl Commands {
}

pub fn main() -> anyhow::Result<()> {
let command = Commands::from_args();
let command = Commands::parse();
command.execute::<DefaultConfig>()
}

Expand Down
2 changes: 1 addition & 1 deletion khonsu-universal-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
[dependencies]
devx-cmd = "0.5"
devx-pre-commit = "0.5"
structopt = "0.3"
clap = { version = "3", features = ["derive"] }
badge = "0.3"
anyhow = "1"
serde_json = "1"
Expand Down
10 changes: 5 additions & 5 deletions khonsu-universal-tools/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
pub use anyhow;
pub use badge;
pub use clap;
pub use devx_cmd;
pub use structopt;

pub mod audit;
pub mod code_coverage;
pub mod pre_commit;
use self::{audit::Audit, code_coverage::CodeCoverage};

use structopt::StructOpt;
use clap::Parser;

#[derive(StructOpt, Debug)]
#[derive(Parser, Debug)]
pub enum Commands {
/// Generates a code coverage report.
GenerateCodeCoverageReport {
#[structopt(long = "install-dependencies")]
#[clap(long = "install-dependencies")]
install_dependencies: bool,
},
/// Executes `cargo-deny`
Expand All @@ -36,7 +36,7 @@ impl Commands {
}

pub fn main() -> anyhow::Result<()> {
let command = Commands::from_args();
let command = Commands::parse();
command.execute::<DefaultConfig>()
}

Expand Down

0 comments on commit 37600ef

Please sign in to comment.