Skip to content

Commit

Permalink
Switch CLI argument parsing to clap v3
Browse files Browse the repository at this point in the history
As discussed in #298, switches command-line argument processing from
`gumdrop` to `clap` v3.0.0-beta.4.

This release of `clap`, despite still being beta, has moved many of the
warnings around the stability of the API. They are also cutting scope of
an initial release upstream, which are good signs that they will get to
a stable release soon.
  • Loading branch information
rsdy authored and tony-iqlusion committed Oct 6, 2021
1 parent 2f02d5d commit cb50f67
Show file tree
Hide file tree
Showing 27 changed files with 277 additions and 1,033 deletions.
198 changes: 154 additions & 44 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 cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ categories = ["command-line-interface", "config", "rust-patterns"]
keywords = ["abscissa", "cli", "application", "framework", "service"]

[dependencies]
gumdrop = "0.7"
clap = "3.0.0-beta.4"
handlebars = "4"
ident_case = "1"
serde = { version = "1", features = ["serde_derive"] }
Expand Down
6 changes: 3 additions & 3 deletions cli/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::{commands::CliCommand, config::CliConfig};
use abscissa_core::{
application::{AppCell, State},
config::{self, CfgCell},
trace, Application, EntryPoint, FrameworkError, StandardPaths,
trace, Application, FrameworkError, StandardPaths,
};

/// Application state
Expand All @@ -21,7 +21,7 @@ pub struct CliApplication {
}

impl Application for CliApplication {
type Cmd = EntryPoint<CliCommand>;
type Cmd = CliCommand;
type Cfg = CliConfig;
type Paths = StandardPaths;

Expand All @@ -46,7 +46,7 @@ impl Application for CliApplication {
Ok(())
}

fn tracing_config(&self, command: &EntryPoint<CliCommand>) -> trace::Config {
fn tracing_config(&self, command: &CliCommand) -> trace::Config {
if command.verbose {
trace::Config::verbose()
} else {
Expand Down

0 comments on commit cb50f67

Please sign in to comment.