1use clap::{Parser, Subcommand, ValueEnum};
4
5#[derive(Debug, Parser)]
6#[command(name = "opennexus")]
7#[command(author, version, about, long_about = None)]
8#[command(propagate_version = true)]
9pub struct Cli {
10 #[command(subcommand)]
12 pub command: Option<Commands>,
13
14 #[arg(long, global = true, default_value = "text")]
16 pub format: OutputFormat,
17}
18
19impl Cli {
20 pub fn parse_args() -> Self {
21 Self::parse()
22 }
23}
24
25#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, ValueEnum)]
26pub enum OutputFormat {
27 #[default]
28 Text,
29 Json,
30}
31
32#[derive(Debug, Clone, Subcommand)]
33pub enum Commands {
34 Setup,
36
37 Update,
39
40 Uninstall,
42}