Skip to content

Commit

Permalink
chore(deps): update arg parsing to clap v3 (#1017)
Browse files Browse the repository at this point in the history
* Update arg parsing to clap v3
* Ignore shell argument case
  • Loading branch information
tranzystorekk authored Jan 23, 2022
1 parent 5f86dc4 commit e58b67c
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 127 deletions.
141 changes: 76 additions & 65 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 src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ mod sessions;
mod tests;

use zellij_utils::{
clap::Parser,
cli::{CliArgs, Command, Sessions},
logging::*,
structopt::StructOpt,
};

fn main() {
configure_logger();
let opts = CliArgs::from_args();
let opts = CliArgs::parse();

if let Some(Command::Sessions(Sessions::ListSessions)) = opts.command {
commands::list_sessions();
Expand Down
1 change: 1 addition & 0 deletions zellij-tile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ description = "A small client-side library for writing Zellij plugins"
license = "MIT"

[dependencies]
clap = { version = "3.0", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
strum = "0.20.0"
Expand Down
3 changes: 2 additions & 1 deletion zellij-tile/src/data.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use clap::ArgEnum;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::str::FromStr;
Expand Down Expand Up @@ -82,7 +83,7 @@ pub enum Event {
}

/// Describes the different input modes, which change the way that keystrokes will be interpreted.
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, EnumIter, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, EnumIter, Serialize, Deserialize, ArgEnum)]
pub enum InputMode {
/// In `Normal` mode, input is always written to the terminal, except for the shortcuts leading
/// to other modes
Expand Down
3 changes: 2 additions & 1 deletion zellij-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ license = "MIT"
anyhow = "1.0.45"
backtrace = "0.3.55"
bincode = "1.3.1"
clap = { version = "3.0", features = ["derive", "env"] }
clap_complete = "3.0"
colored = "2.0.0"
colorsys = "0.6.5"
crossbeam = "0.8.0"
Expand All @@ -26,7 +28,6 @@ serde_yaml = "0.8"
serde_json = "1.0"
signal-hook = "0.3"
strip-ansi-escapes = "0.1.0"
structopt = "0.3"
strum = "0.20.0"
termion = "1.5.0"
thiserror = "1.0.30"
Expand Down
Loading

0 comments on commit e58b67c

Please sign in to comment.