diff options
| author | 2025-02-04 22:14:54 -0600 | |
|---|---|---|
| committer | 2025-02-04 22:14:54 -0600 | |
| commit | 7960fdcbff44b4cd858203562a8f613efe39eb8d (patch) | |
| tree | b4b662be8d87560db518d432a4b09cb61f5df95c /ozone-cli/src/cli.rs | |
| parent | mess with stuff (diff) | |
get started on cli
Diffstat (limited to 'ozone-cli/src/cli.rs')
| -rw-r--r-- | ozone-cli/src/cli.rs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ozone-cli/src/cli.rs b/ozone-cli/src/cli.rs new file mode 100644 index 0000000..d288e3c --- /dev/null +++ b/ozone-cli/src/cli.rs @@ -0,0 +1,46 @@ +use std::path::PathBuf;
+use clap::{Args, Parser, Subcommand};
+
+#[derive(Subcommand, Debug)]
+pub enum ProfileCommand {
+ Select,
+ Create,
+ List
+}
+
+#[derive(Args, Debug)]
+pub struct ProfileArgs {
+ #[command(subcommand)]
+ subcmd: Option<ProfileCommand>
+}
+
+impl ProfileArgs {
+ pub fn take_command(&mut self) -> ProfileCommand {
+ self.subcmd.take().unwrap_or(ProfileCommand::List)
+ }
+}
+
+#[derive(Subcommand, Debug)]
+pub enum RootCommand {
+ Profile(ProfileArgs),
+ Instance,
+
+}
+
+#[derive(Parser, Debug)]
+#[clap(version)]
+pub struct Cli {
+ /// Run the launcher in offline mode. The launcher will not attempt to make any requests using
+ /// the network. The launcher _will_ verify the integrity of files required to launch the game,
+ /// and refuse to launch the game with an error if it must download a file.
+ #[arg(long, global = true)]
+ pub offline: bool,
+
+ /// Directory which the launcher will perform its work in. Defaults to an application-specific
+ /// directory based on your OS.
+ #[arg(long, global = true, value_hint = clap::ValueHint::DirPath)]
+ pub home: Option<PathBuf>,
+
+ #[command(subcommand)]
+ pub subcmd: RootCommand
+}
|
