diff options
Diffstat (limited to 'plugins/tedge_dummy_plugin')
-rw-r--r-- | plugins/tedge_dummy_plugin/Cargo.toml | 2 | ||||
-rw-r--r-- | plugins/tedge_dummy_plugin/src/main.rs | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/tedge_dummy_plugin/Cargo.toml b/plugins/tedge_dummy_plugin/Cargo.toml index 01e8b841..fe598005 100644 --- a/plugins/tedge_dummy_plugin/Cargo.toml +++ b/plugins/tedge_dummy_plugin/Cargo.toml @@ -8,5 +8,5 @@ license = "Apache-2.0" description = "thin.edge.io dummy plugin for testing" [dependencies] -structopt = "0.3" +clap = { version = "3", features = ["derive"] } thiserror = "1.0" diff --git a/plugins/tedge_dummy_plugin/src/main.rs b/plugins/tedge_dummy_plugin/src/main.rs index 3f22276b..2914a256 100644 --- a/plugins/tedge_dummy_plugin/src/main.rs +++ b/plugins/tedge_dummy_plugin/src/main.rs @@ -1,12 +1,12 @@ -use structopt::StructOpt; +use clap::Parser; -#[derive(StructOpt)] +#[derive(Parser)] struct PluginCli { - #[structopt(subcommand)] + #[clap(subcommand)] operation: PluginOp, } -#[derive(StructOpt)] +#[derive(clap::Subcommand)] pub enum PluginOp { /// List all the installed modules List, @@ -47,7 +47,7 @@ impl InternalError { fn main() { // Emulate plugin's API. - let apt = PluginCli::from_args(); + let apt = PluginCli::parse(); match apt.operation { PluginOp::List |