diff options
Diffstat (limited to 'plugins/tedge_apama_plugin')
-rw-r--r-- | plugins/tedge_apama_plugin/Cargo.toml | 2 | ||||
-rw-r--r-- | plugins/tedge_apama_plugin/src/main.rs | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/plugins/tedge_apama_plugin/Cargo.toml b/plugins/tedge_apama_plugin/Cargo.toml index 6a4a2bc0..0bd2c457 100644 --- a/plugins/tedge_apama_plugin/Cargo.toml +++ b/plugins/tedge_apama_plugin/Cargo.toml @@ -13,7 +13,7 @@ assets = [ ] [dependencies] -structopt = "0.3" +clap = { version = "3", features = ["derive"] } thiserror = "1.0" zip = "0.5" roxmltree = "0.14" diff --git a/plugins/tedge_apama_plugin/src/main.rs b/plugins/tedge_apama_plugin/src/main.rs index 7bf7a1b5..6a75e6e5 100644 --- a/plugins/tedge_apama_plugin/src/main.rs +++ b/plugins/tedge_apama_plugin/src/main.rs @@ -1,23 +1,23 @@ mod error; use crate::error::InternalError; +use clap::Parser; use std::fs::{self, File}; use std::io::ErrorKind; use std::path::Path; use std::process::{Command, Stdio}; -use structopt::StructOpt; /// This plugin supports the installation, update and removal of a single unversioned apama project named "project". /// Installation of multiple parallel projects is not supported. /// Installing a project will replace the existing project with the new one. /// Delta update of a project(for eg: updating just the `mon` file definitions in the project) is not supported either. -#[derive(StructOpt)] +#[derive(Parser)] struct ApamaCli { - #[structopt(subcommand)] + #[clap(subcommand)] operation: PluginOp, } -#[derive(StructOpt)] +#[derive(clap::Subcommand)] pub enum PluginOp { /// List the one and only apama project if one is installed List, @@ -25,16 +25,16 @@ pub enum PluginOp { /// Install an apama project Install { module: String, - #[structopt(short = "v", long = "--module-version")] + #[clap(short = 'v', long = "--module-version")] version: Option<String>, - #[structopt(long = "--file")] + #[clap(long = "--file")] file_path: String, }, /// Remove an apama project Remove { module: String, - #[structopt(short = "v", long = "--module-version")] + #[clap(short = 'v', long = "--module-version")] version: Option<String>, }, @@ -300,7 +300,7 @@ fn run_cmd(cmd: &str, args: &str) -> Result<(), InternalError> { fn main() { // On usage error, the process exits with a status code of 1 - let apama = ApamaCli::from_args(); + let apama = ApamaCli::parse(); match run(apama.operation) { Ok(()) => { |