Skip to content

Commit

Permalink
Upgrade clap and clap_complete version (#154)
Browse files Browse the repository at this point in the history
* Update dep version

* Update clap functions

* Update

* Formatting

* Update old test

* Change value_name to num_args

* move completion cmd inside uds
  • Loading branch information
TheRustyPickle committed Mar 28, 2023
1 parent 666958d commit 7e53410
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 88 deletions.
66 changes: 41 additions & 25 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
Expand Up @@ -19,7 +19,7 @@ exclude = ["/assets"]

[dependencies]
tokio = { version = "1.19.2", features = ["macros", "rt-multi-thread", "time", "sync"] }
clap = "3.2.22"
clap = "4.1.10"
chrono = "0.4.22"
chrono-tz= "0.6.3"
gluesql = { version ="0.13.1", default-features = false, features = ["memory-storage"] }
Expand All @@ -32,7 +32,7 @@ serde = "1.0.144"
reqwest = { version = "0.11", features = ["json"] }
colored = "2"
bincode = { version = "2.0.0-rc.1", features = ["alloc"]}
clap_complete = "3.2.2"
clap_complete = "4.1.5"
rustyline = "11.0.0"

[[bin]]
Expand Down
17 changes: 17 additions & 0 deletions src/command/action.rs
@@ -1,3 +1,5 @@
use clap::builder::Str;

use crate::{
command::application::{CLEAR, CREATE, DELETE, EXIT, HISTORY, LIST, LS, Q, QUEUE, TEST},
error::ParseError,
Expand Down Expand Up @@ -47,3 +49,18 @@ impl From<ActionType> for String {
}
}
}

impl From<ActionType> for Str {
fn from(action: ActionType) -> Self {
match action {
ActionType::Create => CREATE.into(),
ActionType::Queue => QUEUE.into(),
ActionType::Delete => DELETE.into(),
ActionType::List => LIST.into(),
ActionType::Test => TEST.into(),
ActionType::Exit => EXIT.into(),
ActionType::Clear => CLEAR.into(),
ActionType::History => HISTORY.into(),
}
}
}

0 comments on commit 7e53410

Please sign in to comment.