Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit 029ae53

Browse files
authored
Merge pull request #116 from bacongobbler/command-aliases
introduce command aliases
2 parents 87a6b04 + e13072d commit 029ae53

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed

src/cli/commands/app.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
use clap::Subcommand;
22

33
#[derive(Subcommand)]
4+
#[clap(alias ="a")]
5+
#[clap(alias ="apps")]
46
pub(crate) enum Commands {
57
/// Add an application
8+
#[clap(alias ="new")]
69
Add {
710
/// The name of the application
811
name: String,
912
/// The Bindle ID where releases will be uploaded
1013
storage_id: String,
1114
},
1215
/// Remove an application
16+
#[clap(alias ="delete")]
17+
#[clap(alias ="rm")]
1318
Remove {
1419
/// The application ID
1520
id: String,

src/cli/commands/bindle.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ use std::path::PathBuf;
33
use clap::Subcommand;
44

55
#[derive(Subcommand)]
6+
#[clap(alias ="b")]
67
pub(crate) enum Commands {
78
/// Prepare a bindle, but write it to disk instead of sending it over the network
9+
#[clap(alias ="prep")]
810
Prepare {
911
/// The artifacts spec (file or directory containing HIPPOFACTS file)
1012
#[clap(parse(from_os_str), default_value = ".")]
@@ -25,6 +27,7 @@ pub(crate) enum Commands {
2527
},
2628

2729
/// Package and upload Hippo artifacts without notifying Hippo
30+
#[clap(alias ="p")]
2831
Push {
2932
/// The artifacts spec (file or directory containing HIPPOFACTS file)
3033
#[clap(parse(from_os_str), default_value = ".")]

src/cli/commands/certificate.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ use std::path::PathBuf;
33
use clap::Subcommand;
44

55
#[derive(Subcommand)]
6+
#[clap(alias ="cert")]
7+
#[clap(alias ="certs")]
8+
#[clap(alias ="certificates")]
69
pub(crate) enum Commands {
710
/// Add a TLS certificate
11+
#[clap(alias ="new")]
812
Add {
913
/// The name of the certificate
1014
name: String,
@@ -16,6 +20,8 @@ pub(crate) enum Commands {
1620
private_key_path: PathBuf,
1721
},
1822
/// Remove a TLS certificate
23+
#[clap(alias ="delete")]
24+
#[clap(alias ="rm")]
1925
Remove {
2026
/// The certificate ID
2127
id: String,

src/cli/commands/channel.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
use clap::Subcommand;
22

33
#[derive(Subcommand)]
4+
#[clap(alias ="c")]
5+
#[clap(alias ="channels")]
46
pub(crate) enum Commands {
57
/// Add a channel
8+
#[clap(alias ="new")]
69
Add {
710
/// The name of the channel
811
name: String,
@@ -27,6 +30,8 @@ pub(crate) enum Commands {
2730
certificate_id: Option<String>,
2831
},
2932
/// Remove a channel
33+
#[clap(alias ="delete")]
34+
#[clap(alias ="rm")]
3035
Remove {
3136
/// The channel ID
3237
id: String,

src/cli/commands/environment_variable.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
use clap::Subcommand;
22

33
#[derive(Subcommand)]
4+
#[clap(alias ="e")]
5+
#[clap(alias ="envvar")]
6+
#[clap(alias ="envvars")]
7+
#[clap(alias ="environmentvariable")]
8+
#[clap(alias ="environmentvariables")]
49
pub(crate) enum Commands {
510
/// Add an environment variable
11+
#[clap(alias ="new")]
612
Add {
713
/// The environment variable key
814
key: String,
@@ -12,6 +18,8 @@ pub(crate) enum Commands {
1218
channel_id: String,
1319
},
1420
/// Remove an environment variable
21+
#[clap(alias ="delete")]
22+
#[clap(alias ="rm")]
1523
Remove {
1624
/// The environment variable ID
1725
id: String,

src/cli/commands/revision.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
use clap::Subcommand;
22

33
#[derive(Subcommand)]
4+
#[clap(alias ="r")]
5+
#[clap(alias ="revisions")]
46
pub(crate) enum Commands {
57
/// Add a revision
8+
#[clap(alias ="new")]
69
Add {
710
/// The storage ID of the Bindle
811
app_storage_id: String,

0 commit comments

Comments
 (0)