Skip to content

Commit

Permalink
chore: Remove Structopt dependency in favor of Clap 3.X
Browse files Browse the repository at this point in the history
  • Loading branch information
devanlooches committed Jul 24, 2024
1 parent 7a83638 commit 1d7efa3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ categories = ["command-line-utilities"]

[dependencies]
any_terminal_size = "0.1.21"
clap = { version = "4.5.10", features = ["derive"] }
console = "0.15.8"
dirs = "5.0.1"
libmacchina = "7.3.0"
regex = "1.10.5"
secfmt = "0.1.1"
serde = "1.0.204"
serde_derive = "1.0.204"
structopt = "0.3.26"
textwrap = "0.16.1"
toml = "0.8.15"
user-error = "1.2.8"
Expand Down
6 changes: 3 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use structopt::StructOpt;
use clap::Parser;
use user_error::UserFacingError;

#[derive(StructOpt)]
#[structopt(
#[derive(Parser)]
#[command(
about = "A WIP command line system information tool (neofetch) rewritten in rust for performance with toml file configuration."
)]
pub struct Opt {
Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use std::cmp::Ordering;
use std::collections::HashMap;

use any_terminal_size::any_terminal_size;
use clap::Parser;
use console::measure_text_width;
use console::style;
use structopt::StructOpt;
use user_error::{UserFacingError, UFE};

use crate::cli::Mode;
Expand Down Expand Up @@ -43,7 +43,7 @@ pub struct Config {

impl Config {
pub fn get_args() -> Opt {
Opt::from_args()
Opt::parse()
}
pub fn path() -> String {
let matches = Self::get_args();
Expand Down

0 comments on commit 1d7efa3

Please sign in to comment.