summaryrefslogtreecommitdiffstats
path: root/ozone-cli/src/cli.rs
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-02-05 12:07:32 -0600
committerLibravatar bigfoot547 <[email protected]>2025-02-05 12:07:32 -0600
commit98f56de8b11b563f8323627322fddfb9b39c88c5 (patch)
treea8e191490ce52bbf85d26703e026442e41b22281 /ozone-cli/src/cli.rs
parentno changes ignore (diff)
small cli changes
Diffstat (limited to 'ozone-cli/src/cli.rs')
-rw-r--r--ozone-cli/src/cli.rs28
1 files changed, 23 insertions, 5 deletions
diff --git a/ozone-cli/src/cli.rs b/ozone-cli/src/cli.rs
index d288e3c..407ee50 100644
--- a/ozone-cli/src/cli.rs
+++ b/ozone-cli/src/cli.rs
@@ -1,10 +1,28 @@
use std::path::PathBuf;
use clap::{Args, Parser, Subcommand};
+#[derive(Args, Debug)]
+pub struct ProfileSelectArgs {
+ /// The name of the profile to select.
+ #[arg(index = 1)]
+ pub profile: String
+}
+
+#[derive(Args, Debug)]
+pub struct ProfileCreateArgs {
+ /// The name of the new profile.
+ #[arg(index = 1)]
+ pub name: String,
+
+ /// Clone profile information from an existing profile.
+ #[arg(long, short = 'c')]
+ pub clone: String
+}
+
#[derive(Subcommand, Debug)]
pub enum ProfileCommand {
- Select,
- Create,
+ Select(ProfileSelectArgs),
+ Create(ProfileCreateArgs),
List
}
@@ -15,8 +33,8 @@ pub struct ProfileArgs {
}
impl ProfileArgs {
- pub fn take_command(&mut self) -> ProfileCommand {
- self.subcmd.take().unwrap_or(ProfileCommand::List)
+ pub fn command(&self) -> &ProfileCommand {
+ self.subcmd.as_ref().unwrap_or(&ProfileCommand::List)
}
}
@@ -24,7 +42,7 @@ impl ProfileArgs {
pub enum RootCommand {
Profile(ProfileArgs),
Instance,
-
+ Launch
}
#[derive(Parser, Debug)]