Skip to content

Commit

Permalink
Use arg! instead of Arg in crc
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Rigo committed Aug 14, 2023
1 parent 523e5d5 commit ac3e3ed
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/crcapp.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate crc;
use crate::applet::Applet;
use anyhow::{bail, Result};
use clap::{arg, Arg, Command};
use clap::{arg, Command};
use crc::*;
use std::process;

Expand Down Expand Up @@ -84,11 +84,7 @@ impl Applet for CRCApplet {
Command::new(self.command())
.about(self.description())
.arg(arg!(-l --list "List supported CRC algorithms"))
.arg(
Arg::new("type")
.help("CRC type to compute")
.required_unless_present("list"),
)
.arg(arg!(<type> "CRC type to compute").required_unless_present("list"))
.arg(arg!([value] "input value, reads from stdin in not present"))
}

Expand Down

0 comments on commit ac3e3ed

Please sign in to comment.