Skip to content

Commit

Permalink
Clean up CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
Colonial-Dev committed Jan 14, 2025
1 parent 93294dd commit 0c45cfe
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 44 deletions.
29 changes: 15 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 28 additions & 30 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,59 +21,61 @@ pub struct ContainerSet {

#[derive(Debug, Subcommand)]
pub enum Command {
/// Compile definitions into container images.
Build {
/// The definitions to build.
defs: Vec<String>,
/// Whether or not to operate on all definitions.
#[arg(short, long)]
all: bool,
/// Whether or not to ignore unchanged definitions.
#[arg(short, long)]
force: bool,
},
/// List all managed containers (alias: ls)
#[clap(alias = "ls")]
Containers,
/// List all managed definitions
Definitions,

/// Create a new container definition.
Create { name: String },
/// Edit an existing container definition.
Edit { name: String },
/// List all managed definitions (alias: lsd)
#[clap(alias = "lsd")]
Definitions,
/// Delete a container definition.
Delete { name: String, #[arg(short, long)] yes: bool },
/// Remove managed container(s).
Down (ContainerSet),
/// Edit an existing container definition.
Edit { name: String },
/// Invoke $SHELL inside a container.
Enter { name: String },
/// Execute a command inside a container.
Exec {
/// The name of the container.
/// Execute a command inside a new ephemeral container.
Ephemeral {
/// The name or ID of the image to use.
name: String,
/// The program to execute.
path: String,
/// Arguments to the program, if any.
#[arg(allow_hyphen_values = true)]
args: Vec<String>,
},
/// Execute a command inside a new ephemeral container.
Ephemeral {
/// The name or ID of the image to use.
/// Execute a command inside a container.
Exec {
/// The name of the container.
name: String,
/// The program to execute.
path: String,
/// Arguments to the program, if any.
#[arg(allow_hyphen_values = true)]
args: Vec<String>,
},

/// Compile definitions into container images.
Build {
/// The definitions to build.
defs: Vec<String>,
/// Whether or not to operate on all definitions.
#[arg(short, long)]
all: bool,
/// Whether or not to ignore unchanged definitions.
#[arg(short, long)]
force: bool,
},

/// Restart managed container(s).
Restart (ContainerSet),
/// Remove and re-create managed container(s).
Reup (ContainerSet),
/// Start managed container(s).
Start (ContainerSet),
/// Stop managed containers(s).
Stop (ContainerSet),
/// Restart managed container(s).
Restart (ContainerSet),
/// Create managed container(s).
Up {
/// One or more images; can use names and IDs interchangeably.
Expand All @@ -85,10 +87,6 @@ pub enum Command {
#[arg(short, long)]
replace: bool,
},
/// Remove managed container(s).
Down (ContainerSet),
/// Remove and re-create managed container(s).
Reup (ContainerSet),

#[clap(hide = true)]
Init {
Expand Down

0 comments on commit 0c45cfe

Please sign in to comment.