Skip to content

Commit

Permalink
handle cli errors gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
Alw3ys committed Feb 12, 2024
1 parent 6eed264 commit 94dd8ee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions dctl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ fn cli() -> Command {
.version(VERSION)
.subcommand_required(true)
.arg_required_else_help(true)
.allow_external_subcommands(true)
.subcommand(run::sub_command())
.subcommand(Command::new("export").about("Export a Dosei App"))
.subcommand(Command::new("login").about("Log in to a cluster"))
Expand All @@ -37,8 +36,7 @@ fn cli() -> Command {

fn main() -> anyhow::Result<()> {
let config: &'static Config = Box::leak(Box::new(Config::new()?));
let matches = cli().get_matches();
match matches.subcommand() {
match cli().get_matches().subcommand() {
Some(("run", arg_matches)) => run(arg_matches),
Some(("export", _)) => export(),
Some(("login", _)) => login(config),
Expand Down

0 comments on commit 94dd8ee

Please sign in to comment.