Skip to content

Commit

Permalink
Convert to declarative Clap structs
Browse files Browse the repository at this point in the history
  • Loading branch information
nickray committed Jan 7, 2022
1 parent 6f99bac commit 6bac36d
Show file tree
Hide file tree
Showing 7 changed files with 691 additions and 778 deletions.
4 changes: 2 additions & 2 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
@@ -1,6 +1,6 @@
[package]
name = "solo2"
version = "0.1.0"
version = "0.1.1"
authors = ["SoloKeys Developers"]
edition = "2021"
rust-version = "1.56"
Expand Down
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ fn main() {

// Use clap to build completion files.
// Pro-tip: use `fd -HIe bash` to get OUT_DIR
let mut app = cli::cli();
use clap::IntoApp;
let mut app = cli::Cli::into_app();
generate_to(shells::Bash, &mut app, "solo2", &outdir).unwrap();
generate_to(shells::Fish, &mut app, "solo2", &outdir).unwrap();
generate_to(shells::PowerShell, &mut app, "solo2", &outdir).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/apps/oath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl Secret {
/// length of 160 bits."
///
/// But 14B = 112b < 128b.
fn from_base32(encoded: &str, digest: Digest) -> Result<Self> {
pub fn from_base32(encoded: &str, digest: Digest) -> Result<Self> {
let unshortened = data_encoding::BASE32.decode(encoded.as_bytes())?;
let mut shortened = match digest {
Digest::Sha1 => {
Expand Down
742 changes: 317 additions & 425 deletions src/bin/solo2/cli.rs

Large diffs are not rendered by default.

Loading

0 comments on commit 6bac36d

Please sign in to comment.