Skip to content

Commit

Permalink
feat(subcommand): set arg_required_else_help=true for all shapes su…
Browse files Browse the repository at this point in the history
…bcommands
  • Loading branch information
mateusfg7 committed Nov 24, 2023
1 parent 0ab329f commit 3bfb72d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/shapes/circle/command.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::Parser;

#[derive(Parser)]
#[command(about="Mathematical operations with circles", long_about = None)]
#[command(about="Mathematical operations with circles", long_about = None, arg_required_else_help=true)]
pub struct Command {
#[arg(short, long, help = "Sets the radius of the circle | e.g. -r 5")]
pub radius: f64,
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/rhombus/command.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::Parser;

#[derive(Parser)]
#[command(about="Mathematical operations with rhombus", long_about = None)]
#[command(about="Mathematical operations with rhombus", long_about = None, arg_required_else_help=true)]
pub struct Command {
#[arg(
short = 'l',
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/square/command.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::Parser;

#[derive(Parser)]
#[command(about="Mathematical operations with squares", long_about = None)]
#[command(about="Mathematical operations with squares", long_about = None, arg_required_else_help=true)]
pub struct Command {
#[arg(short, long, help = "Sets the Base of the square | e.g. -b 5")]
pub base: i32,
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/trapezoid/command.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::Parser;

#[derive(Parser)]
#[command(about="Mathematical operations with trapezoids", long_about = None)]
#[command(about="Mathematical operations with trapezoids", long_about = None, arg_required_else_help=true)]
pub struct Command {
#[arg(
short = 'l',
Expand Down
2 changes: 1 addition & 1 deletion src/shapes/triangle/command.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::Parser;

#[derive(Parser)]
#[command(about="Mathematical operations with triangles", long_about = None)]
#[command(about="Mathematical operations with triangles", long_about = None, arg_required_else_help=true)]
pub struct Command {
#[arg(short, long, help = "Sets the Base of the triangle | e.g. -b 5")]
pub base: Option<f32>,
Expand Down

0 comments on commit 3bfb72d

Please sign in to comment.