Skip to content

Commit

Permalink
deps: port from structopt to clap
Browse files Browse the repository at this point in the history
  • Loading branch information
decathorpe authored and danobi committed Oct 23, 2023
1 parent de35617 commit 54ce798
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 133 deletions.
188 changes: 60 additions & 128 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ maintenance = { status = "actively-developed" }

[dependencies]
anyhow = "1.0"
clap = { version = "4", features = ["derive"] }
lazy_static = "1.4"
log = "0.4"
memmap2 = "0.9"
nix = "0.26"
pom = "3.2"
rustyline = { version = "12", features = ["derive"] }
simplelog = "0.12"
structopt = "0.3"
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use anyhow::{bail, Result};
use log::{error, info};
use rustyline::{config::Config as EditorConfig, error::ReadlineError, history::FileHistory, Editor, Helper};
use simplelog::{Color, ColorChoice, ConfigBuilder, Level, LevelFilter, TermLogger, TerminalMode};
use structopt::StructOpt;
use clap::Parser;

mod btrfs;
mod input;
Expand All @@ -19,10 +19,10 @@ use lang::runtime::Runtime;
const HISTORY_FILE: &str = ".btrd_history";
const PROMPT: &str = "(btrd) ";

#[derive(StructOpt)]
#[derive(Parser)]
struct Opt {
/// Show debug output
#[structopt(short, long)]
#[clap(short, long)]
debug: bool,
/// Run a script (instead of running the REPL)
script: Option<PathBuf>,
Expand Down Expand Up @@ -137,7 +137,7 @@ fn script(sink: &mut dyn Write, script: &Path) -> Result<()> {
}

fn main() -> Result<()> {
let opts = Opt::from_args();
let opts = Opt::parse();
init_logging(opts.debug)?;

let mut stdout = std::io::stdout();
Expand Down

0 comments on commit 54ce798

Please sign in to comment.