diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 8971ed8..0366b4c 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -1,15 +1,10 @@ - - - use std::fmt::Display; use clap::{Parser, Subcommand, ValueEnum}; #[derive(Parser, Debug)] -#[command(author, version, about, long_about = None)] +#[command(author, version, about, long_about = None, arg_required_else_help = true)] pub struct Cli { - - #[command(subcommand)] pub comm: Option, @@ -20,19 +15,20 @@ pub struct Cli { #[derive(Subcommand, Debug)] pub enum Subc { - - Run {filename: String}, - Build {filename: String, output: String}, - View { - + Run { filename: String, - - #[arg(short, long, default_value_t = FormatKind::FancyTable)] - format: FormatKind - }, - Debug {} + Build { + filename: String, + output: String, + }, + View { + filename: String, + #[arg(short, long, default_value_t = FormatKind::FancyTable)] + format: FormatKind, + }, + Debug {}, } #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)] @@ -43,7 +39,6 @@ pub enum FormatKind { Serializable, } - impl Display for FormatKind { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { @@ -54,5 +49,3 @@ impl Display for FormatKind { } } } - -