Skip to content

Commit

Permalink
add back run command, but as default
Browse files Browse the repository at this point in the history
  • Loading branch information
neelayjunnarkar committed Nov 16, 2024
1 parent fc37d17 commit 4aa9a68
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions insanity-native-tui-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,24 @@ struct Cli {
#[clap(long)]
room: Option<String>,

/// IPV4, IPV6, or dualstack
/// ipv4, ipv6, or dualstack
#[clap(long, value_enum, default_value_t = IpVersion::Dualstack)]
ip_version: IpVersion,
}

#[derive(Subcommand, Debug)]
enum Commands {
/// Connect to room [default]
Run,
/// Update insanity.
Update {
#[clap(long, default_value_t = false)]
dry_run: bool,

#[clap(long, default_value_t = false)]
force: bool,
},
/// Print contents of the file (if any) being used for configuration.
PrintConfigFile,
}

Expand Down Expand Up @@ -120,7 +124,7 @@ async fn main() -> anyhow::Result<()> {
let cli_opts: Cli = Cli::parse();

match cli_opts.command {
None => run(cli_opts).await,
None | Some(Commands::Run) => run(cli_opts).await,
Some(Commands::Update { dry_run, force }) => update::update(dry_run, force).await,
Some(Commands::PrintConfigFile) => Ok(print_config_file(cli_opts.config_file)),
}
Expand Down

0 comments on commit 4aa9a68

Please sign in to comment.