Skip to content

Commit

Permalink
Migrate structopt from to clap. It had an issue with its dependency, …
Browse files Browse the repository at this point in the history
  • Loading branch information
paazmaya committed Aug 26, 2023
1 parent 1eb06f5 commit 42ae749
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 76 deletions.
146 changes: 75 additions & 71 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ license = "MIT"
[dependencies]

# Parse command line argument by defining a struct
# https://crates.io/crates/structopt
structopt = "0.3"
# https://github.com/clap-rs/clap/
clap = { version = "3.0", features = ["derive"] }

# Recursively walk a directory
# https://crates.io/crates/walkdir
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ use crate::file_counter::*;

// Add the necessary imports
use std::path::PathBuf;
use structopt::StructOpt;
use clap::StructOpt;

// Define the command-line options using structopt
#[derive(StructOpt)]
struct Cli {
#[structopt(parse(from_os_str))]
directory: PathBuf,

#[structopt(short = "e", long = "extensions")]
#[structopt(short = 'e', long = "extensions")]
extensions: Vec<String>,

#[structopt(short = "r", long = "recursive")]
#[structopt(short = 'r', long = "recursive")]
recursive: bool,
}

Expand Down

0 comments on commit 42ae749

Please sign in to comment.