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

Migrate cli implementation from clap to structopt #8027

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
6c733c4
[Refactor] move Unload into its own struct
sajjaphani Nov 27, 2020
e981e40
[Refactor] reuse unload struct from svc
sajjaphani Nov 27, 2020
7a5e24b
[Refactor] reuse stop struct from svc
sajjaphani Nov 27, 2020
07b8595
[Refactor] reuse start struct from svc
sajjaphani Nov 28, 2020
b745493
[Refactor] extract and reuse status struct from svc
sajjaphani Nov 29, 2020
126bc73
[Refactor] reuse config apply struct from config
sajjaphani Nov 29, 2020
818c5d5
[Refactor] move pkg download into its own struct
sajjaphani Nov 29, 2020
4e9434a
[Refactor] reuse pkg download struct from pkg
sajjaphani Nov 29, 2020
a62ec20
[Refactor] move pkg build into its own struct
sajjaphani Nov 29, 2020
7f6a0d6
[Refactor] reuse pkg build struct from pkg
sajjaphani Nov 29, 2020
b836fe0
[Refactor] move cli setup into its own struct
sajjaphani Nov 30, 2020
457dba1
[Refactor] reuse cli setup struct from cli
sajjaphani Nov 30, 2020
c95ed5a
[Refactor] move cli completers into its own struct
sajjaphani Nov 30, 2020
642aba4
[Refactor] reuse cli completers struct from cli
sajjaphani Nov 30, 2020
f210f3e
[Refactor] move alias term into a struct
sajjaphani Nov 30, 2020
b2a657d
[Refactor] create and reuse cli term struct from sup
sajjaphani Nov 30, 2020
ca3a370
[Refactor] reuse pkg install struct from pkg
sajjaphani Dec 1, 2020
70a4b1b
[Refactor] move non_empty into util, fix failing test
sajjaphani Dec 1, 2020
5d9b74f
remove unused funciton
sajjaphani Dec 1, 2020
f3d9269
fix rustfmt errors
sajjaphani Dec 1, 2020
054fba6
[Refactor] extract and reuse config apply struct
sajjaphani Dec 2, 2020
a6b1cfa
[Refactor] extract and reuse file upload struct
sajjaphani Dec 2, 2020
d8a632a
[Refactor] reuse user key struct from user
sajjaphani Dec 2, 2020
51a3502
[Refactor] extract and reuse svc key struct from svc
sajjaphani Dec 2, 2020
330046b
[Refactor] reuse license struct from licese
sajjaphani Dec 2, 2020
6b1f71c
[Refactor] move and reuse job start into struct from bldr
sajjaphani Dec 2, 2020
f98758d
[Refactor] move and reuse job cancel into a struct from bldr
sajjaphani Dec 2, 2020
c44a65a
[Refactor] move and reuse job promote into a struct from bldr
sajjaphani Dec 2, 2020
0bce7ea
[Refactor] move and reuse job demote into a struct from bldr
sajjaphani Dec 2, 2020
d85c19b
[Refactor] move and reuse channel create into a struct from bldr
sajjaphani Dec 3, 2020
5b456d7
[Refactor] move and reuse channel destroy into a struct from bldr
sajjaphani Dec 3, 2020
c07ab68
[Refactor] move and reuse channel demote into a struct from bldr
sajjaphani Dec 3, 2020
4ac289e
[Refactor] move and reuse channel promote into a struct from bldr
sajjaphani Dec 3, 2020
38aabdb
[Refactor] move and reuse channel list into a struct from bldr
sajjaphani Dec 3, 2020
d18eda6
[Refactor] move and reuse ley export into a struct from ring
sajjaphani Dec 3, 2020
e41c8c8
[Refactor] move and reuse key generate into a struct from ring
sajjaphani Dec 3, 2020
4eb7838
remove dead code
sajjaphani Dec 3, 2020
69dd432
[Refactor] move and reuse key import into a struct from ring
sajjaphani Dec 3, 2020
043dfe2
[Refactor] move and reuse plan init into a struct from plan
sajjaphani Dec 3, 2020
bf7d916
[Refactor] move and reuse plan render into a struct from plan
sajjaphani Dec 3, 2020
8cd61b2
[Refactor] reuse pkg list from pkg
sajjaphani Dec 3, 2020
498c79b
[Refactor] extract and reuse pkg verify struct from pkg
sajjaphani Dec 3, 2020
3fe5d80
[Refactor] extract and reuse pkg upload struct from pkg
sajjaphani Dec 3, 2020
093fafa
[Refactor] extract and reuse pkg uninstall struct from pkg
sajjaphani Dec 3, 2020
cbc0892
[Refactor] extract and reuse pkg sign struct from pkg
sajjaphani Dec 3, 2020
3435e86
[Refactor] extract and reuse pkg search struct from pkg
sajjaphani Dec 3, 2020
1630e55
[Refactor] extract and reuse pkg provides struct from pkg
sajjaphani Dec 3, 2020
04b102d
[Refactor] extract and reuse pkg bulkupload struct from pkg
sajjaphani Dec 3, 2020
22b42ad
[Refactor] extract and reuse pkg binlink struct from pkg
sajjaphani Dec 3, 2020
e74181a
[Refactor] extract and reuse pkg dependencies struct from pkg
sajjaphani Dec 3, 2020
de342cc
[Refactor] extract and reuse pkg path struct from pkg
sajjaphani Dec 3, 2020
8893bc9
[Refactor] extract and reuse pkg binds struct from pkg
sajjaphani Dec 3, 2020
c3adcb7
[Refactor] extract and reuse pkg info struct from pkg
sajjaphani Dec 3, 2020
49d5048
[Refactor] extract and reuse pkg header struct from pkg
sajjaphani Dec 3, 2020
b26e9f2
[Refactor] extract and reuse pkg hash struct from pkg
sajjaphani Dec 3, 2020
33afacd
[Refactor] extract and reuse pkg env struct from pkg
sajjaphani Dec 3, 2020
6ae3c45
[Refactor] extract and reuse origin transfer struct from origin
sajjaphani Dec 3, 2020
114dccb
[Refactor] extract and reuse origin info struct from origin
sajjaphani Dec 3, 2020
6e69a46
[Refactor] extract and reuse origin depart struct from origin
sajjaphani Dec 3, 2020
182d6f5
[Refactor] extract and reuse origin delete struct from origin
sajjaphani Dec 3, 2020
804a906
[Refactor] extract and reuse origin create struct from origin
sajjaphani Dec 3, 2020
ddc6007
[Refactor] extract and reuse invitations send struct from origin
sajjaphani Dec 3, 2020
bca8e09
[Refactor] extract and reuse invitations rescind struct from origin
sajjaphani Dec 3, 2020
b96f832
[Refactor] extract and reuse invitations pending struct from origin
sajjaphani Dec 3, 2020
18c0246
[Refactor] extract and reuse invitations list struct from origin
sajjaphani Dec 3, 2020
24c7b3d
[Refactor] extract and reuse invitations ignore struct from origin
sajjaphani Dec 3, 2020
b672994
[Refactor] extract and reuse invitations accept struct from origin
sajjaphani Dec 4, 2020
094c546
[Refactor] extract and reuse key download struct from origin
sajjaphani Dec 4, 2020
d78abce
[Refactor] extract and reuse key generate struct from origin
sajjaphani Dec 4, 2020
f5e201d
[Refactor] extract and reuse pkg config struct from pkg
sajjaphani Dec 4, 2020
9218fcd
[Refactor] extract and reuse pkg channels struct from pkg
sajjaphani Dec 4, 2020
9cc670a
[Refactor] extract and reuse pkg promote struct from pkg
sajjaphani Dec 4, 2020
b72ee85
[Refactor] extract and reuse pkg demote struct from pkg
sajjaphani Dec 4, 2020
582001c
[Refactor] extract and reuse pkg delete struct from pkg
sajjaphani Dec 5, 2020
6c0d77b
[Refactor] extract and reuse job status struct from bldr
sajjaphani Dec 5, 2020
d577b7c
remove unused function
sajjaphani Dec 5, 2020
c8ff478
[Refactor] extract and reuse key upload struct from origin
sajjaphani Dec 5, 2020
ddc9bfe
[Refactor] extract and reuse secret upload struct from origin
sajjaphani Dec 5, 2020
cb38b6f
[Refactor] extract and reuse secret list struct from origin
sajjaphani Dec 5, 2020
b3e23c0
[Refactor] extract and reuse secret delete struct from origin
sajjaphani Dec 5, 2020
ae8878f
[Refactor] extract and reuse key import struct from origin
sajjaphani Dec 5, 2020
dce5e8e
[Refactor] extract and reuse key export struct from origin
sajjaphani Dec 5, 2020
01a33c8
fix rustfmt errors
sajjaphani Dec 5, 2020
beb606a
[Refactor] adjust user subcommand
sajjaphani Dec 5, 2020
c054a89
[Refactor] extract a struct for the root clap app
sajjaphani Dec 6, 2020
7f9f04c
fix rustfmt errors
sajjaphani Dec 6, 2020
d8c0dc0
fix clippy errors
sajjaphani Dec 6, 2020
82b9aa7
[PR Feedback] remove unnecessary doc comment, fix variant
sajjaphani Dec 6, 2020
c24056a
[PR Feedback] add comment on Serialize
sajjaphani Dec 6, 2020
0d5fd66
[PR Feedback] corrected spelling error
sajjaphani Dec 8, 2020
93e6ba0
[PR Feedback] make them lower case
sajjaphani Dec 8, 2020
70f3eb0
Added aliases
sajjaphani Dec 9, 2020
9a092ef
[Refactor] added user wrapper to hab
sajjaphani Dec 9, 2020
5cd3562
added settings to hab licence
sajjaphani Dec 9, 2020
e39b352
[Refactor] added bldr wrapper to hab
sajjaphani Dec 9, 2020
e35c713
[Refactor] added cli wrapper to hab
sajjaphani Dec 9, 2020
35d5b84
[Refactor] added service config wrapper to hab
sajjaphani Dec 9, 2020
26f1eb1
[Refactor] added file wrapper to hab
sajjaphani Dec 9, 2020
e9b88a0
[Refactor] added ring wrapper to hab
sajjaphani Dec 10, 2020
5061136
[Refactor] added plan wrapper to hab
sajjaphani Dec 10, 2020
a4c83e2
[Refactor] added pkg wrapper to hab, need to fix mismatched types
sajjaphani Dec 10, 2020
c100702
fix the Pkg use
sajjaphani Dec 10, 2020
aa0fc91
[Refactor] added origin wrapper to hab
sajjaphani Dec 10, 2020
4c7fd39
[Refactor] remove redundant options
sajjaphani Dec 10, 2020
0da1a55
fix rustfmt errors
sajjaphani Dec 10, 2020
c63e2a1
[PR Feedback] use wildcard to import modules declarations
sajjaphani Dec 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,156 changes: 17 additions & 1,139 deletions components/hab/src/cli.rs

Large diffs are not rendered by default.

292 changes: 258 additions & 34 deletions components/hab/src/cli/hab.rs
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
mod bldr;
mod cli;
mod config;
mod file;
pub mod bldr;
pub mod cli;
pub mod config;
pub mod file;
pub mod license;
pub mod origin;
pub mod pkg;
mod plan;
mod ring;
pub mod plan;
pub mod ring;
pub mod studio;
pub mod sup;
pub mod svc;
#[cfg(test)]
mod tests;
mod user;
pub mod user;
pub mod util;

use self::{bldr::{Bldr,
ConfigOptBldr},
cli::{Cli,
ConfigOptCli},
config::{ConfigOptServiceConfig,
ConfigOptServiceConfigApply,
ServiceConfig,
ServiceConfigApply},
file::{ConfigOptFile,
File},
use self::{bldr::*,
cli::{CliCompleters,
CliSetup,
ConfigOptCliCompleters,
ConfigOptCliSetup},
config::{ConfigOptServiceConfigApply,
ConfigOptServiceConfigShow,
ServiceConfigApply,
ServiceConfigShow},
file::{ConfigOptFileUpload,
FileUpload},
license::{ConfigOptLicense,
License},
origin::{ConfigOptOrigin,
Origin},
pkg::{ConfigOptPkg,
ConfigOptPkgInstall,
Pkg,
PkgInstall},
plan::{ConfigOptPlan,
Plan},
ring::{ConfigOptRing,
Ring},
origin::*,
pkg::*,
plan::{ConfigOptPlanInit,
ConfigOptPlanRender,
PlanInit,
PlanRender},
ring::{ConfigOptRingKeyExport,
ConfigOptRingKeyGenerate,
ConfigOptRingKeyImport,
RingKeyExport,
RingKeyGenerate,
RingKeyImport},
studio::{ConfigOptStudio,
Studio},
sup::{ConfigOptHabSup,
Expand All @@ -49,8 +52,8 @@ use self::{bldr::{Bldr,
Svc,
SvcStart,
SvcStop},
user::{ConfigOptUser,
User},
user::{ConfigOptUserKeyGenerate,
UserKeyGenerate},
util::{CacheKeyPath,
ConfigOptCacheKeyPath}};
use crate::{cli::AFTER_HELP,
Expand All @@ -77,7 +80,7 @@ pub enum Hab {
Config(ServiceConfig),
#[structopt(no_version)]
File(File),
#[structopt(no_version)]
#[structopt(no_version, settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
License(License),
#[structopt(no_version)]
Origin(Origin),
Expand All @@ -103,23 +106,244 @@ pub enum Hab {
#[structopt(no_version, settings = &[AppSettings::Hidden])]
Apply(ServiceConfigApply),
/// Alias for 'pkg install'
#[structopt(no_version, settings = &[AppSettings::Hidden])]
#[structopt(no_version, settings = &[AppSettings::Hidden], aliases = &["i", "in", "ins", "inst", "insta", "instal"])]
Install(PkgInstall),
#[cfg(not(target_os = "macos"))]
/// Alias for 'sup run'
#[structopt(no_version, settings = &[AppSettings::Hidden])]
Run(SupRun),
/// Alias for 'cli setup'
#[structopt(no_version, settings = &[AppSettings::Hidden])]
#[structopt(no_version, settings = &[AppSettings::Hidden], aliases = &["set", "setu"])]
Setup(CacheKeyPath),
/// Alias for 'svc start'
#[structopt(no_version, settings = &[AppSettings::Hidden])]
#[structopt(no_version, settings = &[AppSettings::Hidden], aliases = &["sta", "star"])]
Start(SvcStart),
/// Alias for 'svc stop'
#[structopt(no_version, settings = &[AppSettings::Hidden])]
#[structopt(no_version, settings = &[AppSettings::Hidden], aliases = &["sto"])]
Stop(SvcStop),
#[cfg(not(target_os = "macos"))]
/// Alias for 'sup term'
#[structopt(no_version, settings = &[AppSettings::Hidden])]
Term,
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(no_version, aliases = &["b", "bl", "bld"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to Habitat Builder
pub enum Bldr {
#[structopt(no_version)]
Channel(Channel),
#[structopt(no_version)]
Job(Job),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(no_version, aliases = &["c", "ch", "cha", "chan", "chann", "channe"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to Habitat Builder channels
pub enum Channel {
#[structopt(no_version, aliases = &["c", "cr", "cre", "crea", "creat"])]
Create(ChannelCreate),
Demote(ChannelDemote),
#[structopt(no_version, aliases = &["d", "de", "des", "dest", "destr", "destro"])]
Destroy(ChannelDestroy),
#[structopt(no_version, aliases = &["l", "li", "lis"])]
List(ChannelList),
Promote(ChannelPromote),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(no_version, aliases = &["j", "jo"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to Habitat Builder jobs
pub enum Job {
#[structopt(no_version, aliases = &["c", "ca", "can", "cance", "cancel"])]
Cancel(JobCancel),
#[structopt(no_version, aliases = &["d", "de", "dem", "demo", "demot"])]
Demote(JobDemote),
#[structopt(no_version, aliases = &["p", "pr", "pro", "prom", "promo", "promot"])]
Promote(JobPromote),
#[structopt(no_version, aliases = &["s", "st", "sta", "star"])]
Start(JobStart),
#[structopt(no_version, aliases = &["stat", "statu"])]
Status(JobStatus),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(no_version, aliases = &["cl"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to Habitat runtime config
pub enum Cli {
#[structopt(no_version, aliases = &["s", "se", "set", "setu"])]
/// Sets up the CLI with reasonable defaults
Setup(CliSetup),
#[structopt(no_version, aliases = &["c", "co", "com", "comp"])]
/// Creates command-line completers for your shell
Completers(CliCompleters),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(no_version, aliases = &["co", "con", "conf", "confi"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to a Service's runtime config
pub enum ServiceConfig {
#[structopt(no_version, aliases = &["ap", "app", "appl"])]
Apply(ServiceConfigApply),
#[structopt(no_version, aliases = &["sh", "sho"])]
Show(ServiceConfigShow),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(no_version, aliases = &["f", "fi", "fil"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to Habitat files
pub enum File {
#[structopt(no_version, aliases = &["u", "up", "upl", "uplo", "uploa"])]
/// Uploads a file to be shared between members of a Service Group
Upload(FileUpload),
}

/// Commands relating to Habitat users
#[derive(ConfigOpt, StructOpt)]
#[structopt(name = "user", no_version, aliases = &["u", "us", "use"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
pub enum User {
Key(UserKey),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(name = "key", no_version, aliases = &["k", "ke"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to Habitat user keys
pub enum UserKey {
#[structopt(no_version, aliases = &["g", "ge", "gen", "gene", "gener", "genera", "generat"])]
Generate(UserKeyGenerate),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(no_version, aliases = &["o", "or", "ori", "orig", "origi"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to Habitat Builder origins
pub enum Origin {
#[structopt(no_version, aliases = &["cre", "crea"])]
Create(OriginCreate),
#[structopt(no_version, aliases = &["del", "dele"])]
Delete(OriginDelete),
Depart(OriginDepart),
Info(OriginInfo),
Invitations(OriginInvitations),
Key(OriginKey),
/// Role Based Access Control for origin members
Rbac(Rbac),
Secret(OriginSecret),
Transfer(OriginTransfer),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(no_version, settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Manage origin member invitations
pub enum OriginInvitations {
Accept(InvitationsAccept),
Ignore(InvitationsIgnore),
List(InvitationsList),
Pending(InvitationsPending),
Rescind(InvitationsRescind),
Send(InvitationsSend),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(name = "key", no_version, aliases = &["k", "ke"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to Habitat origin key maintenance
pub enum OriginKey {
#[structopt(no_version, aliases = &["d", "do", "dow", "down", "downl", "downlo", "downloa"])]
Download(OriginKeyDownload),
#[structopt(no_version, aliases = &["e", "ex", "exp", "expo", "expor"])]
Export(OriginKeyExport),
#[structopt(no_version, aliases = &["g", "ge", "gen", "gene", "gener", "genera", "generat"])]
Generate(OriginKeyGenerate),
#[structopt(no_version, aliases = &["i", "im", "imp", "impo", "impor"])]
Import(OriginKeyImport),
#[structopt(no_version, aliases = &["u", "up", "upl", "uplo", "uploa"])]
Upload(OriginKeyUpload),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(name = "secret", no_version, settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands related to secret management
pub enum OriginSecret {
Delete(SecretDelete),
List(SecretList),
Upload(SecretUpload),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(no_version, aliases = &["p", "pk", "package"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to Habitat packages
pub enum Pkg {
Binds(PkgBinds),
#[structopt(no_version, aliases = &["bi", "bin", "binl", "binli", "binlin"])]
Binlink(PkgBinlink),
#[structopt(no_version)]
Build(PkgBuild),
#[structopt(no_version, aliases = &["conf", "cfg"])]
Config(PkgConfig),
Download(PkgDownload),
Env(PkgEnv),
Exec(PkgExec),
Export(ExportCommand),
#[structopt(no_version, aliases = &["ha", "has"])]
Hash(PkgHash),
#[structopt(no_version, aliases = &["i", "in", "ins", "inst", "insta", "instal"])]
Install(PkgInstall),
#[structopt(no_version, aliases = &["p", "pa", "pat"])]
Path(PkgPath),
#[structopt(no_version, aliases = &["li"])]
List(PkgList),
Provides(PkgProvides),
Search(PkgSearch),
#[structopt(no_version, aliases = &["s", "si", "sig"])]
Sign(PkgSign),
#[structopt(no_version, aliases = &["un", "unin"])]
Uninstall(PkgUninstall),
#[structopt(no_version, aliases = &["bul", "bulk"])]
Bulkupload(PkgBulkupload),
#[structopt(no_version, aliases = &["u", "up", "upl", "uplo", "uploa"])]
Upload(PkgUpload),
#[structopt(no_version, aliases = &["del", "dele"])]
Delete(PkgDelete),
#[structopt(no_version, aliases = &["pr", "pro", "promo", "promot"])]
Promote(PkgPromote),
#[structopt(no_version, aliases = &["de", "dem", "demo", "demot"])]
Demote(PkgDemote),
#[structopt(no_version, aliases = &["ch", "cha", "chan", "chann", "channe", "channel"])]
Channels(PkgChannels),
#[structopt(no_version, aliases = &["v", "ve", "ver", "veri", "verif"])]
Verify(PkgVerify),
#[structopt(no_version, aliases = &["hea", "head", "heade", "header"])]
Header(PkgHeader),
#[structopt(no_version, aliases = &["inf", "info"])]
Info(PkgInfo),
#[structopt(no_version, aliases = &["dep", "deps"])]
Dependencies(PkgDependencies),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(no_version, aliases = &["pl", "pla"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to plans and other app-specific configuration
pub enum Plan {
#[structopt(no_version, aliases = &["i", "in", "ini"])]
Init(PlanInit),
#[structopt(no_version, aliases = &["r", "re", "ren", "rend", "rende"])]
Render(PlanRender),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(no_version, aliases = &["r", "ri", "rin"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to Habitat rings
pub enum Ring {
Key(RingKey),
}

#[derive(ConfigOpt, StructOpt)]
#[structopt(name = "key", no_version, aliases = &["k", "ke"], settings = &[AppSettings::ArgRequiredElseHelp, AppSettings::SubcommandRequiredElseHelp])]
/// Commands relating to Habitat ring keys
pub enum RingKey {
#[structopt(no_version, aliases = &["e", "ex", "exp", "expo", "expor"])]
Export(RingKeyExport),
#[structopt(no_version, aliases = &["i", "im", "imp", "impo", "impor"])]
Import(RingKeyImport),
#[structopt(no_version, aliases = &["g", "ge", "gen", "gene", "gener", "genera", "generat"])]
Generate(RingKeyGenerate),
}
Loading