Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wacker-cli: unify clap attributes and remove unnecessary ones #13

Merged
merged 1 commit into from Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions wacker-cli/src/commands/delete.rs
Expand Up @@ -3,8 +3,7 @@ use clap::Parser;
use tonic::transport::Channel;
use wacker_api::{modules_client::ModulesClient, DeleteRequest};

#[derive(Parser, PartialEq)]
#[structopt(name = "delete", aliases = &["rm"])]
#[derive(Parser)]
pub struct DeleteCommand {
/// Module ID
#[arg(required = true)]
Expand Down
3 changes: 1 addition & 2 deletions wacker-cli/src/commands/list.rs
Expand Up @@ -7,8 +7,7 @@ use tabled::{
use tonic::transport::Channel;
use wacker_api::{modules_client::ModulesClient, ModuleStatus};

#[derive(Parser, PartialEq)]
#[structopt(name = "list", aliases = &["ps"])]
#[derive(Parser)]
pub struct ListCommand {}

#[derive(Tabled)]
Expand Down
3 changes: 1 addition & 2 deletions wacker-cli/src/commands/logs.rs
Expand Up @@ -4,8 +4,7 @@ use std::process::Command;
use tonic::transport::Channel;
use wacker_api::config::LOGS_DIR;

#[derive(Parser, PartialEq)]
#[structopt(name = "logs", aliases = &["log"])]
#[derive(Parser)]
pub struct LogsCommand {
/// Module ID
#[arg(required = true)]
Expand Down
3 changes: 1 addition & 2 deletions wacker-cli/src/commands/restart.rs
Expand Up @@ -3,8 +3,7 @@ use clap::Parser;
use tonic::transport::Channel;
use wacker_api::{modules_client::ModulesClient, RestartRequest};

#[derive(Parser, PartialEq)]
#[structopt(name = "restart")]
#[derive(Parser)]
pub struct RestartCommand {
/// Module ID
#[arg(required = true)]
Expand Down
3 changes: 1 addition & 2 deletions wacker-cli/src/commands/run.rs
Expand Up @@ -3,8 +3,7 @@ use clap::Parser;
use tonic::transport::Channel;
use wacker_api::{modules_client::ModulesClient, RunRequest};

#[derive(Parser, PartialEq)]
#[structopt(name = "run")]
#[derive(Parser)]
pub struct RunCommand {
/// Module file path
#[arg(required = true)]
Expand Down
3 changes: 1 addition & 2 deletions wacker-cli/src/commands/stop.rs
Expand Up @@ -3,8 +3,7 @@ use clap::Parser;
use tonic::transport::Channel;
use wacker_api::{modules_client::ModulesClient, StopRequest};

#[derive(Parser, PartialEq)]
#[structopt(name = "stop")]
#[derive(Parser)]
pub struct StopCommand {
/// Module ID
#[arg(required = true)]
Expand Down
15 changes: 9 additions & 6 deletions wacker-cli/src/main.rs
Expand Up @@ -11,23 +11,26 @@ use wacker_api::config::SOCK_PATH;
#[command(name = "wacker")]
#[command(author, version, about, long_about = None)]
struct Wacker {
#[clap(subcommand)]
#[command(subcommand)]
subcommand: Subcommand,
}

#[derive(Parser, PartialEq)]
#[derive(Parser)]
enum Subcommand {
/// Runs a WebAssembly module
Run(commands::RunCommand),
/// List running WebAssembly modules
/// Lists running WebAssembly modules
#[command(visible_alias = "ps")]
List(commands::ListCommand),
/// Stops a WebAssembly module
Stop(commands::StopCommand),
/// Restart a WebAssembly module
/// Restarts a WebAssembly module
Restart(commands::RestartCommand),
/// Delete a WebAssembly module
/// Deletes a WebAssembly module
#[command(visible_alias = "rm")]
Delete(commands::DeleteCommand),
/// Fetch the logs of a module
/// Fetches logs of a module
#[command(visible_alias = "log")]
Logs(commands::LogsCommand),
}

Expand Down