🐴 RusTOTPony β€” CLI manager of one-time password generators aka Google Authenticator

Overview

🐴 RusTOTPony

crates.io

CLI manager of time-based one-time password generators. It is a desktop alternative for Google Authenticator.

Installation

Arch Linux

Packages, available in AUR:

Other

Grab an appropriate binary from the latest release and put it in a place of your choice. If you're on *nix system, don't forget to set proper permissions: chmod +x totp.

Build manually

From crates.io

Make sure you have $HOME/.cargo/bin in your $PATH.

$ cargo install rustotpony

From source

  1. Clone this repo
  2. Run cargo install from the inside of the repo directory
  3. Keep calm and wait for compilation

Probably, you will need gcc (Linux) or clang (Mac OS) to compile dependencies.

Usage

$ totp help
🐴  RusTOTPony 0.2.3
German Lashevich <[email protected]>
CLI manager of one-time password generators aka Google Authenticator

USAGE:
    totp [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    add          Add a new generator
    dash         Show realtime dashboard with all generators
    delete       Delete generator
    eradicate    Delete all generators
    help         Prints this message or the help of the given subcommand(s)
    list         List all generators
    rename       Rename generator

Try `totp help [SUBCOMMAND]` to see help for the given subcommand

Choose your password wisely

At the very first run totp asks for a password for a new database. It's located at $HOME/.rustotpony/db.json (don't be confused by json extension, actually, it's a binary file). If you forget the password or want to change it, you have to remove $HOME/.rustotpony directory. It's not convenient, but I'm going to improve usablity and an option for changing password.

Basic scenario

  1. Retrieve a secret key from your TOTP provider (it must be encoded with base32, for example: GEZDGMZSGE2TKCQ=)

    $ # Creating a fake secret key for demo purposes
    $ echo 123321555 | base32
    GEZDGMZSGE2TKNIK
  2. Add new generator with totp add <NAME> (you will be asked for a secret and a password)

    $ # Adding a new TOTP generator
    $ totp add demo
    Enter your secret code: 
    Enter your database pass: 
    New application created: demo

    If it's not the first run, you'll be asked for password twice: for opening database and for saving it.

  3. Use totp list to check your secrets

    $ # Listing all secrets in the database
    $ totp list
    Enter your database pass: 
    +------+------------------+----------+
    | name | key              | username |
    +------+------------------+----------+
    | demo | GEZDGMZSGE2TKNIK |          |
    +------+------------------+----------+
  4. Use totp dash or just totp for realtime dashboard

    $ # Display real-time dashboard with all generators
    $ totp
    Enter your database pass: 
    Welcome to RusTOTPony realtime dashboard! Press ^C to quit.
    [=============================================               ]
    009216 demo
  5. After hitting ^C it'll cleanup the dashboard

    $ totp
    Enter your database pass: 
    I won't tell anyone about this 🀫

TODO

  • command completion
  • database password caching
  • tests
  • refactor show and show-all commands

License

Licensed under the MIT License.

Comments
  • Update all dependencies

    Update all dependencies

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | patch | ^4.0.29 -> ^4.0.32 | | serde (source) | dependencies | patch | 1.0.151 -> 1.0.152 | | serde_derive (source) | dependencies | patch | 1.0.151 -> 1.0.152 | | serde_json | dependencies | patch | 1.0.89 -> 1.0.91 |


    Release Notes

    clap-rs/clap

    v4.0.32

    Compare Source

    Fixes
    • (parser) When overriding required(true), consider args that conflict with its group

    v4.0.31

    Compare Source

    Performance
    • Speed up parsing when a lot of different flags are present (100 unique flags)

    v4.0.30

    Compare Source

    Fixes
    • (error) Improve error for args_conflicts_with_subcommand
    serde-rs/serde

    v1.0.152

    Compare Source

    • Documentation improvements
    serde-rs/json

    v1.0.91

    Compare Source

    • Opt out of -Zrustdoc-scrape-examples on docs.rs for now

    v1.0.90

    Compare Source

    • Documentation improvements

    Configuration

    πŸ“… Schedule: Branch creation - "before 3am on Monday" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ‘» Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update all dependencies to 1.0.151

    Update all dependencies to 1.0.151

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | serde (source) | dependencies | patch | 1.0.148 -> 1.0.151 | | serde_derive (source) | dependencies | patch | 1.0.148 -> 1.0.151 |


    Release Notes

    serde-rs/serde

    v1.0.151

    Compare Source

    • Update serde::{ser,de}::StdError to re-export core::error::Error when serde is built with feature="std" off and feature="unstable" on (#​2344)

    v1.0.150

    Compare Source

    • Relax some trait bounds from the Serialize impl of HashMap and BTreeMap (#​2334)
    • Enable Serialize and Deserialize impls of std::sync::atomic types on more platforms (#​2337, thanks @​badboy)

    v1.0.149

    Compare Source


    Configuration

    πŸ“… Schedule: Branch creation - "before 3am on Monday" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update all dependencies

    Update all dependencies

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | patch | ^4.0.18 -> ^4.0.29 | | rpassword | dependencies | minor | ^7.1.0 -> ^7.2.0 | | serde (source) | dependencies | patch | 1.0.147 -> 1.0.148 | | serde_derive (source) | dependencies | patch | 1.0.147 -> 1.0.148 | | serde_json | dependencies | patch | 1.0.87 -> 1.0.89 |


    Release Notes

    clap-rs/clap

    v4.0.29

    Compare Source

    v4.0.28

    Compare Source

    Fixes
    • Fix wasm support which was broken in 4.0.27

    v4.0.27

    Compare Source

    Features
    • Have Arg::value_parser accept Vec<impl Into<PossibleValue>>
    • Implement Display and FromStr for ColorChoice
    Fixes
    • Remove soundness issue by switching from atty to is-terminal

    v4.0.26

    Compare Source

    Fixes
    • (error) Fix typos in ContextKind::as_str

    v4.0.25

    Compare Source

    Features
    • (error) Report available subcommands when required subcommand is missing

    v4.0.24

    Compare Source

    Fixes
    • Avoid panic when printing an argument that isn't built

    v4.0.23

    Compare Source

    Fixes
    • Don't panic on reporting invalid-long errors when followed by invalid UTF8
    • (help) Clarified argument to help subcommand

    v4.0.22

    Compare Source

    Fixes
    • (help) Don't overflow into next-line-help early due to stale (pre-v4) padding calculations

    v4.0.21

    Compare Source

    Features
    • (derive) long_about and long_help attributes, without a value, force using doc comment (before it wouldn't be set if there wasn't anything different than the short help)

    v4.0.20

    Compare Source

    Fixes
    • (derive) Allow defaulted value parser for '()' fields

    v4.0.19

    Compare Source

    Features
    • ColorChoice now implements ValueEnum
    conradkleinespel/rpassword

    v7.2.0

    Compare Source

    This release completely removes the dependency on serde. It adds a new dependency rtoolbox which are utility functions I use in multiple projects. This change is meant to improve supply chain security. I don't own serde but I do ownrtoolbox. Code for rtoolbox is available in the mono-repo.

    No functionality changes in this release. It is backwards compatible.

    serde-rs/serde

    v1.0.148

    Compare Source

    • Support remote derive for generic types that have private fields (#​2327)
    serde-rs/json

    v1.0.89

    Compare Source

    • Fix invalid JSON incorrectly accepted when a large number has no digits after decimal point (#​953)

    v1.0.88

    Compare Source


    Configuration

    πŸ“… Schedule: Branch creation - "before 3am on Monday" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ‘» Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update all dependencies

    Update all dependencies

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/cache | action | major | v1 -> v3 | | actions/checkout | action | major | v1 -> v3 | | actions/upload-release-asset | action | patch | v1.0.1 -> v1.0.2 | | clap | dependencies | patch | ^4.0.15 -> ^4.0.18 | | ctrlc | dependencies | minor | 3.0 -> 3.2 | | serde (source) | dependencies | patch | 1.0.24 -> 1.0.147 | | serde_derive (source) | dependencies | patch | 1.0.24 -> 1.0.147 | | serde_json | dependencies | patch | 1.0.8 -> 1.0.87 |


    Release Notes

    actions/cache

    v3

    Compare Source

    v2

    Compare Source

    actions/checkout

    v3

    Compare Source

    v2

    Compare Source

    actions/upload-release-asset

    v1.0.2

    Compare Source

    This is a minor update to make the current release have the latest code from master, and additionally allows for a new automation workflow to execute to automate the sliding of the major (v1, v2, v3, etc) version numbers for ease of referencing

    clap-rs/clap

    v4.0.18

    Compare Source

    Fixes
    • (derive) Allow #[command(skip)] to also work with enum variants with a value

    v4.0.17

    Compare Source

    Fixes
    • Allow using Arg::last(true) with Arg::value_hint(ValueHint::CommandWithArguments)

    v4.0.16

    Compare Source

    Fixes
    • Arg::exclusive(true) should not be exclusive with the argument's own ArgGroup
    Detegr/rust-ctrlc

    v3.2.3

    Compare Source

    v3.2.2

    Compare Source

    v3.2.1

    Compare Source

    v3.2.0

    Compare Source

    Feature termination will now handle SIGINT, SIGTERM and SIGHUP when previously it only handled SIGINT and SIGTERM.

    v3.1.10

    Compare Source

    v3.1.9

    Compare Source

    v3.1.8

    Compare Source

    v3.1.7

    Compare Source

    v3.1.6

    Compare Source

    v3.1.5

    Compare Source

    v3.1.1

    Compare Source

    v3.1.0

    Compare Source

    v3.0.3

    Compare Source

    v3.0.2

    Compare Source

    v3.0.1

    Compare Source

    serde-rs/serde

    v1.0.147

    Compare Source

    • Add serde::de::value::EnumAccessDeserializer which transforms an EnumAccess into a Deserializer (#​2305)

    v1.0.146

    Compare Source

    v1.0.145

    Compare Source

    v1.0.144

    Compare Source

    • Change atomic ordering used by Serialize impl of atomic types to match ordering used by Debug impl of those same types (#​2263, thanks @​taiki-e)

    v1.0.143

    Compare Source

    • Invert build.rs cfgs in serde_test to produce the most modern configuration in the default case (#​2253, thanks @​taiki-e)

    v1.0.142

    Compare Source

    • Add keywords to crates.io metadata

    v1.0.141

    Compare Source

    • Add no-std category to crates.io metadata

    v1.0.140

    Compare Source

    v1.0.139

    Compare Source

    • Add new constructor function for all IntoDeserializer impls (#​2246)

    v1.0.138

    Compare Source

    • Documentation improvements

    v1.0.137

    Compare Source

    v1.0.136

    Compare Source

    • Improve default error message when Visitor fails to deserialize a u128 or i128 (#​2167)

    v1.0.135

    Compare Source

    • Update discord channels listed in readme

    v1.0.134

    Compare Source

    • Improve error messages on deserializing NonZero integers from a 0 value (#​2158)

    v1.0.133

    Compare Source

    • Optimize deserialization of data structures that contain recursive use of flatten fields or tag or untagged enums (#​2148)

    v1.0.132

    Compare Source

    • Enable Serialize and Deserialize impls for std::sync::atomic::{AtomicI64, AtomicU64} on riscv64 arch (#​2141, thanks @​Avimitin)

    v1.0.131

    Compare Source

    v1.0.130

    Compare Source

    • Provide MapAccess and SeqAccess impl for reference to a dynamically sized existing impl (#​2081)

    v1.0.129

    Compare Source

    v1.0.128

    Compare Source

    v1.0.127

    Compare Source

    • Resolve warning in rustc nightly-2021-07-31+ compiling serde_test

    v1.0.126

    Compare Source

    v1.0.125

    Compare Source

    v1.0.124

    Compare Source

    v1.0.123

    Compare Source

    v1.0.122

    Compare Source

    • Add IntoDeserializer impl for &[u8] (#​1898, thanks @​Mingun)

    • Handle unrecognized numeric field keys during deserialization of a field_identifier, equivalently to string field keys (#​1914, thanks @​Mingun)

    • Add attribute to override default deserialization failure expectation message (#​1916, thanks @​Mingun)

      #[derive(Deserialize)]
      #[serde(untagged, expecting = "single version or array of versions")]
      struct VersionSpec {
          One(Version),
          Many(Vec<Version>),
      }
      
    • Improve serde_test handling of map entries and error message construction (#​1918, thanks @​Mingun)

    • Produce more accurate location information on test failures from serde_test crate (#​1920, thanks @​Mingun)

    • Improve diagnostic on failure to parse a rename_all attribute (#​1960, #​1961)

    • Eliminate unnecessary trait bounds on some value Deserializer impls (#​1963)

    v1.0.121

    Compare Source

    v1.0.120

    Compare Source

    v1.0.119

    Compare Source

    v1.0.118

    Compare Source

    v1.0.117

    Compare Source

    v1.0.116

    Compare Source

    • Fix deserialization of IpAddr, SocketAddr, Bound, Result, OsString in formats which process variant identifiers as u64 (#​1888, thanks @​joshtriplett)

    v1.0.115

    Compare Source

    • Support #[serde(flatten)] on a field whose type is a type parameter and concrete type is () (#​1873)

    v1.0.114

    Compare Source

    v1.0.113

    Compare Source

    v1.0.112

    Compare Source

    • Support serde(flatten) on map types where the Serializer only works with serialize_entry (#​1837)

    v1.0.111

    Compare Source

    • Process borrowed lifetimes inside of interpolated macro_rules metavariables, such as in the case of #[derive(Deserialize)] struct S<'a> { field: $field } (#​1821)

    v1.0.110

    Compare Source

    v1.0.109

    Compare Source

    v1.0.108

    Compare Source

    • Provide a Serializer impl that can write primitives and unit variants to a &mut fmt::Formatter (#​1705, thanks @​jethrogb)

      use serde::Serialize;
      use std::fmt::{self, Display};
      
      #[derive(Serialize)]
      #[serde(rename_all = "kebab-case")]
      pub enum MessageType {
          StartRequest,
          EndRequest,
      }
      
      impl Display for MessageType {
          fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
              self.serialize(f)
          }
      }
      

    v1.0.107

    Compare Source

    • Fix panic during macro expansion when using serde(skip) and serde(other) in the same enum (#​1804)

    v1.0.106

    Compare Source

    • Hide dummy const implementation detail from rustdoc when documenting a binary crate (#​1768, thanks @​robo9k)

    v1.0.105

    Compare Source

    v1.0.104

    Compare Source

    v1.0.103

    Compare Source

    • Support deserializing untagged unit variants from formats that treat unit as None (#​1668)

    v1.0.102

    Compare Source

    • Support deserializing PathBuf from bytes like &Path already did, and support deserializing Box<Path> (#​1656, thanks @​heftig)

    v1.0.101

    Compare Source

    • Report errors on malformed serde attributes, like #[serde(rename =)] -- the compiler used to reject these itself, but when the compiler relaxed its requirements on attribute syntax these malformed attributes began silently being ignored by serde_derive

    • Eliminate unused variable warning when using skip_serializing inside a tuple variant of an adjacently tagged enum (#​1617, thanks @​arilotter)

    • Support skip attribute inside of newtype variants (#​1622, thanks @​Xaeroxe)

    v1.0.100

    Compare Source

    • Provide serde::ser::StdError and serde::de::StdError which are either a re-export of std::error::Error (if Serde's "std" feature is enabled) or a new identical trait (otherwise).

      #[cfg(feature = "std")]
      pub use std::error::Error as StdError;
      
      #[cfg(not(feature = "std"))]
      pub trait StdError: Debug + Display {
          fn source(&self) -> Option<&(StdError + 'static)> { None }
      }
      

      Serde's error traits serde::ser::Error and serde::de::Error require std::error::Error as a supertrait, but only when Serde is built with "std" enabled. Data formats that don't care about no_std support should generally provide their error types with a std::error::Error impl directly:

      #[derive(Debug)]
      struct MySerError {...}
      
      impl serde::ser::Error for MySerError {...}
      
      impl std::fmt::Display for MySerError {...}
      
      // We don't support no_std!
      impl std::error::Error for MySerError {}
      

      Data formats that do support no_std may either have a "std" feature of their own as has been required in the past:

      [features]
      std = ["serde/std"]
      
      #[cfg(feature = "std")]
      impl std::error::Error for MySerError {}
      

      ... or else now may provide the std Error impl unconditionally via Serde's re-export:

      impl serde::ser::StdError for MySerError {}
      

    v1.0.99

    Compare Source

    • Update Syn dependency to 1.0.

      Note: This raises the minimum required compiler version for serde_derive from rustc 1.15 to rustc 1.31. The minimum required compiler version for serde remains at rustc 1.13.

    v1.0.98

    Compare Source

    v1.0.97

    Compare Source

    • Introduce serde(try_from = "...") attribute to derive Deserialize based on a given implementation of std::convert::TryFrom (#​1526, thanks @​fanzeyi)

      #[derive(Deserialize)]
      #[serde(try_from = "u32")]
      enum N {
          Zero,
          One,
          Two,
      }
      
      impl TryFrom<u32> for N {
          type Error = String;
      
          fn try_from(u: u32) -> Result<Self, Self::Error> {
              match u {
                  0 => Ok(Self::Zero),
                  1 => Ok(Self::One),
                  2 => Ok(Self::Two),
                  other => Err(format!("out of range: {}", other)),
              }
          }
      }
      

    v1.0.96

    Compare Source

    v1.0.95

    Compare Source

    yanked

    v1.0.94

    Compare Source

    • Accept enums in input data when deserializing IgnoredAny (#​1558)

    v1.0.93

    Compare Source

    • Allow integer keys in untagged flattened map (#​1545)

    v1.0.92

    Compare Source

    v1.0.91

    Compare Source

    • Support deserializing from MapAccessDeserializer into an enum (#​1522)

    v1.0.90

    Compare Source

    • Add an attribute #[serde(crate = "path::to::serde")] which replaces the use of extern crate serde in the generated code; this is intended for crates that invoke Serde derives from a macro and need to refer to serde through their own re-export rather than requiring callers to list Serde in Cargo.toml (#​1499, thanks @​sgrif)

      #[derive(Deserialize)]
      #[serde(crate = "__tw::codegen::serde")]
      struct S { ... }
      
      // expands to:
      impl<'de> __tw::codegen::serde::Deserialize<'de> for S {
          ...
      }
      

    v1.0.89

    Compare Source

    v1.0.88

    Compare Source

    • Support flatten and skip_serializing / skip_deserializing attributes on the same field

    v1.0.87

    Compare Source

    v1.0.86

    Compare Source

    v1.0.85

    Compare Source

    • Accept #[serde(alias = "...")] attribute on fields and variants which allows the same field or variant to be deserialized from any of multiple different names in the input (#​1458, thanks @​Lymia)

      #[derive(Deserialize)]
      struct S {
          #[serde(alias = "old_name")]
          new_name: String,  // will deserialize from either of "old_name" or "new_name"
      }
      

    v1.0.84

    Compare Source

    • Update example code in documentation to 2018 edition

    v1.0.83

    Compare Source

    • Support a rename_all specification that applies only to the Serialize impl or only to the Deserialize impl (#​1447, thanks @​vincascm)

      #[derive(Serialize, Deserialize)]
      #[serde(rename_all(
          serialize = "camelCase",
          deserialize = "SCREAMING_SNAKE_CASE",
      ))]
      struct S { /* ... */ }
      
    • Allow serializing struct name inside of structs with named fields (#​1448, thanks @​motu42)

      #[derive(Serialize)]
      #[serde(tag = "type")]
      struct S { /* ... */ }  // serializes as {"type":"S",...}
      

    v1.0.82

    Compare Source

    • Support serde(default) attribute inside of tuple structs and tuple variants (#​1442, thanks @​tcr)

    v1.0.81

    Compare Source

    • Better error messages when using an invalid combination of serde attributes (#​1424, thanks @​hcpl)
    • Support deserializing tagged enums inside of untagged enums in formats that encode tagged enum variants by index, like MessagePack (#​1437, thanks @​daboross)

    v1.0.80

    Compare Source

    • Performance optimization for Vec::deserialize_in_place to deserialize elements in place (#​1411)

    v1.0.79

    Compare Source

    • Add serde(other) variant attribute for deserializing any variant that is not one of the others (#​1382)

      #[derive(Deserialize)]
      #[serde(tag = "variant")]
      enum MyEnum {
          A(ModelA),
          B(ModelB),
          #[serde(other)]
          Unknown,
      }
      

      In this internally tagged enum the MyEnum::Unknown variant would be produced if the "variant" tag in the input is neither "A" nor "B".

      This feature is currently limited to externally tagged and adjacently tagged enums in which the other variant is a unit variant.

    v1.0.78

    Compare Source

    • Fix panic deserializing flattened Value after flattened struct (#​1379)

    v1.0.77

    Compare Source

    v1.0.76

    Compare Source

    v1.0.75

    Compare Source

    • Adjust dependency version requirement to support building with -Z minimal-versions in CI (#​1367)

    v1.0.74

    Compare Source

    v1.0.73

    Compare Source

    • Fix the names of serialized fields when the Rust data structure uses a raw identifier (#​1362)

    v1.0.72

    Compare Source

    • Fix compilation of default-features = false, features = ["alloc", "rc"] feature combination (#​1359, thanks @​Pratyush)

    v1.0.71

    Compare Source

    v1.0.70

    Compare Source

    • Update --features alloc to work with nightly-2018-07-07 (#​1335)

    v1.0.69

    Compare Source

    v1.0.68

    Compare Source

    v1.0.67

    Compare Source

    • Implement Serialize for core::fmt::Arguments (#​1319)

    v1.0.66

    Compare Source

    v1.0.65

    Compare Source

    • Do not panic when serializing a RefCell that is currently mutably borrowed (#​1300, thanks @​xfix)
    • Allow flattened fields after a flattened map to receive input fields (#​1299)

    v1.0.64

    Compare Source

    • Second attempt to work around docs.rs old compiler version (#​1295)

    v1.0.63

    Compare Source

    • Workaround to get docs.rs successfully building our docs with its old compiler (#​1294)

    v1.0.62

    Compare Source

    v1.0.61

    Compare Source

    • Stabilize Deserialize impls for dynamically sized Rc / Arc (#​1266)
    • Stabilize Deserialize impl for Box<CStr> (#​1267)

    v1.0.60

    Compare Source

    v1.0.59

    Compare Source

    • Add a serde(transparent) container attribute to indicate that a struct serializes and deserializes the same as its only field -- analogous to repr(transparent) (#​1054)

    v1.0.58

    Compare Source

    • Fix generated code for deserializing untagged newtype variant (#​1268)

    v1.0.57

    Compare Source

    • Remove unstable Serialize and Deserialize impls for NonZero<T> which has been removed from the most recent nightly compiler (#​1265)

    v1.0.56

    Compare Source

    • Add a Serde build.rs script for rustc version detection in preparation for adding i128 / u128 primitive support on sufficiently new compilers. Please let us know in #​1136 if having a build script causes undue complication in your environment. We will begin using the build script to enable observable functionality after a week or so, at which point it will become harder to roll back.

    v1.0.55

    Compare Source

    • Support formats that want to deserialize flattened identifiers as bytes (#​1257)

    v1.0.54

    Compare Source

    • Support flattened untagged Options in struct fields (#​1255)

    v1.0.53

    Compare Source

    • Support deserializing flattened untagged enum (#​1253)

    v1.0.52

    Compare Source

    • Allow overriding inferred bounds at the variant level using a bound attribute (#​1149)
    • Respect skip_serializing attribute in tuple structs and variants (#​1048)
    • Account for skip_serializing_if in computing tuple struct lengths (#​1049)
    • Improve error for struct deserialized from array that is too short (#​981)
    • Accept implicitly borrowed data inside of an Option field (#​1029)

    v1.0.51

    Compare Source

    • Fix the Deserialize implementation generated for an adjacently tagged enum with zero variants (#​785)
    • Improve error message when deriving Deserialize for a type that already has a 'de lifetime (#​893)
    • Add a #[serde(skip)] variant attribute to combine the skip_serializing and skip_deserializing variant attributes that already existed
    • Respect variant skip attributes when inferring type parameter bounds (#​892)

    v1.0.50

    Compare Source

    • Detect unsupported use of Deserialize on a dynamically sized struct ending in slice field (#​830)

    v1.0.49

    Compare Source

    v1.0.48

    Compare Source

    • Fix Serialize impl of an adjacently tagged empty tuple variant or struct variant (#​1247)

    v1.0.47

    Compare Source

    • Support flatten attribute inside of enums (#​1206)

    v1.0.46

    Compare Source

    • Support deserializing a flattened internally tagged enum (#​1189)

    v1.0.45

    Compare Source

    • Fix dead code warnings when generating remote impls (#​976)

    v1.0.44

    Compare Source

    • Respect deserialize_with used together with flatten (#​1240)

    v1.0.43

    Compare Source

    • Fix handling of newtype struct inside of an untagged enum in serde_test (#​1233)

    v1.0.42

    Compare Source

    v1.0.41

    Compare Source

    • Allow integers in an internally tagged enum to be deserialized from CBOR integers of any size (#​1222)

    v1.0.40

    Compare Source

    • More flexible deserialization of byte arrays inside of untagged and internally tagged enums (#​1217, #​1216)

    v1.0.39

    Compare Source

    • Implement deserializer hints in handling of untagged and adjacently tagged enums to improve compile time and executable size (#​286)

    v1.0.38

    Compare Source

    v1.0.37

    Compare Source

    v1.0.36

    Compare Source

    • Emit working code in the case of remote = "Self" attribute (#​1196)

    v1.0.35

    Compare Source

    v1.0.34

    Compare Source

    v1.0.33

    Compare Source

    • Fix parsing of Self-qualified paths like "<[_]>::serialize" within serialize_with attributes

    v1.0.32

    Compare Source

    • Fix derive expansion for structs containing &str or &[u8] with missing lifetime parameter (#​1176)

    v1.0.31

    Compare Source

    (yanked)

    v1.0.30

    Compare Source

    v1.0.29

    Compare Source

    • Fix unused parentheses warning in generated code (#​1172)

    v1.0.28

    Compare Source

    • Update to Syn 0.12 which allows serde_derive to handle new Rust syntax that has been added within the past year
    • Report conflicts between the tag of an internally tagged enum and any of the variant field names, or between the tag and content field of an adjacently tagged enum (#​1170, thanks @​H2CO3)

    v1.0.27

    Compare Source

    v1.0.26

    Compare Source

    • Extend Serialize and Deserialize impls on PhantomData to work for T: ?Sized

    v1.0.25

    Compare Source

    • Add the following function with default implementation to the Deserialize trait (thanks @​Gankro!)

      fn deserialize_in_place<D>(deserializer: D, place: &mut Self) -> Result<(), D::Error>
      where
          D: Deserializer<'de>,
      {
          *place = Deserialize::deserialize(deserializer)?;
          Ok(())
      }
      

      This is a power user feature that allows deserialization to reuse existing allocations for types like String and Vec. Enable the deserialize_in_place feature of serde_derive to generate these efficient implementations for all types that use #[derive(Deserialize)].

      extern crate serde;
      extern crate serde_json;
      
      use serde::Deserialize;
      
      fn main() {
          let mut v = Vec::<i32>::with_capacity(128);
          assert_eq!(v.capacity(), 128);
      
          let j = "[1, 2, 3]";
          let ref mut de = serde_json::Deserializer::from_str(j);
          Deserialize::deserialize_in_place(de, &mut v).unwrap();
          assert_eq!(v, [1, 2, 3]);
          assert_eq!(v.capacity(), 128);
      }
      
    serde-rs/json

    v1.0.87

    Compare Source

    • Add write_i128 and write_u128 methods to serde_json::Formatter to control the formatting of 128-bit integers (#​940, thanks @​Lucretiel)

    v1.0.86

    Compare Source

    v1.0.85

    Compare Source

    • Make Display for Number produce the same representation as serializing (#​919)

    v1.0.84

    Compare Source

    • Make Debug impl of serde_json::Value more compact (#​918)

    v1.0.83

    Compare Source

    • Add

    Configuration

    πŸ“… Schedule: Branch creation - "before 3am on Monday" (UTC), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ‘» Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update actions/checkout action to v3 - autoclosed

    Update actions/checkout action to v3 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/checkout | action | major | v1 -> v3 |


    Release Notes

    actions/checkout

    v3

    Compare Source

    v2

    Compare Source


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update actions/cache action to v3 - autoclosed

    Update actions/cache action to v3 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | actions/cache | action | major | v1 -> v3 |


    Release Notes

    actions/cache

    v3

    Compare Source

    v2

    Compare Source


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate rpassword to v7 - autoclosed

    Update Rust crate rpassword to v7 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | rpassword | dependencies | major | 4.0 -> 7.1 |


    Release Notes

    conradkleinespel/rpassword

    v7.1.0

    Compare Source

    This release includes a fix from @​LSchallot which allows users to hit Ctrl-U to remove the password and start from scratch, similar to when you hit Ctrl-U in your terminal to clear the line.

    It also specifies a minimum Rust version in Cargo.toml.

    v7.0.0

    Compare Source

    This release contains a potentially breaking change in that it removes the dependency on serde. But in most cases you should not need to change any of your code. Thanks @​BlackHoleFox for the help.

    Thanks also @​NovaliX-Dev for fixing a bug on Windows, see https://github.com/conradkleinespel/rpassword/commit/38589177d2014c70e04cd93d178ab098333fa742.

    You will need at least Rust 1.60 to use this new release.

    v6.0.1

    Compare Source

    No code changes. Updated docs so they display correctly on sites such as https://docs.rs/rpassword and https://crates.io/crates/rpassword.

    v6.0.0

    Compare Source

    This release contains breaking changes.

    Notable changes:

    • API changes to be more flexible and more generic;
    • move to Rust 2018 edition;
    • WASM/WASI support, thanks @​john-sharratt.

    The API has changed from:

    pub fn read_password() -> Result<String>
    pub fn read_password_from_tty(prompt: Option<&str>) -> ::std::io::Result<String>
    pub fn read_password_with_reader<T: BufRead>(source: Option<&mut T>) -> Result<String>
    
    pub fn prompt_password_stdout(prompt: &str) -> std::io::Result<String>
    pub fn prompt_password_stderr(prompt: &str) -> std::io::Result<String> 
    

    To:

    pub fn read_password_from_bufread(reader: &mut impl BufRead) -> std::io::Result<String>
    pub fn read_password() -> std::io::Result<String>
    
    pub fn prompt_password_from_bufread(reader: &mut impl BufRead, writer: &mut impl Write, prompt: impl ToString) -> std::io::Result<String>
    pub fn prompt_password(prompt: impl ToString) -> std::io::Result<String>
    

    By default, reading and writing is done from/to the TTY instead of stdin/stdout. This is more reliable for most cases. If you need to read or write from/to a different place, the function versions with from_bufread allow you to pass anything you'd like.

    v5.0.1

    Compare Source

    Fixes a unit test, see #​55. No changes in functionality.

    v5.0.0

    Compare Source

    There is 1 breaking change in this release.

    If you use the read_password_with_reader function, you will need to replace any calls to read_password_with_reader(Some(reader)) with read_password_with_reader(Some(&mut reader)). This change allows calling read_password_with_reader multiple times with the same reader, which makes unit testing much easier (see #​46 for some background).

    Thanks @​dvermd for this contribution!

    v4.0.5

    Compare Source

    Fixes a bug that prevented memory from being zeroed in case of an error. Thanks again @​tov !

    This should be non-breaking as long as you use an updated version of the Rust toolchain.

    v4.0.4

    Fixes deprecation warnings. Thanks @​tov !

    This should be non-breaking as long as you use an updated version of the Rust toolchain.

    v4.0.2

    Compare Source

    Updates the README.md instructions so they appear correctly on crates.io. No code changes.

    v4.0.1

    Compare Source

    Updates the README.md instructions so they appear correctly on crates.io. No code changes.


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate keyring to v1 - autoclosed

    Update Rust crate keyring to v1 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | keyring | dependencies | major | 0.7.1 -> 1.2.0 |


    Release Notes

    hwchen/keyring-rs

    v1.2.0

    Compare Source

    As reported in #​86, the MacOS platform treats an empty user-name (or service-name) string as a wildcard when doing a password retrieval. Other platforms do not act this way. As it's a tenet of this module to have consistent behavior on all platforms, a bug fix was needed. The resolution (as documented in #​86 and #​87 and in the docs) is to disallow the use of empty strings for target, service or user names in credentials, causing all attempted uses of such credentials to fail with a "credential not found" error. This resolution does not break the API or any existing API documentation (since the behavior on empty strings was not documented), but as it's a functionality change it merits a minor version bump.

    Existing clients of the API who were relying on platform-specific behavior around the user of empty credential strings can still use this module, but they will have to explicitly specify their platform credentials using the new_with_credential call rather than using new or new_with_target as they may have been.

    v1.1.2

    Compare Source

    • replace structopt with new, improved clap that incoporates all of the same functionality.

    v1.1.1

    • no functional updates, just documentation improvements

    v1.1.0

    • add iOS support

    v1.0.1

    Compare Source

    • fix #​80: missing winapi features (jyuch)

    v1.0.0

    Compare Source

    • Breaking API changes:
      • Keyring struct renamed to Entry
      • KeyringError enum renamed to Error, and is completely cross-platform.
    • API enhancements:
      • Clients can now control how entries map to credentials; see Entry::new_with_target and Entry::new_with_credential
      • Clients can now retrieve platform credentials with metadata rather than just passwords; see Entry::get_password_and_credential.
      • Non UTF8 passwords now have their data available.
      • Non-login keychains are usable on Linux and Mac.
    • Expanded documentation and cli example.

    v0.10.4

    Compare Source

    • CI fix for linux executable

    v0.10.3

    • Added NoPassword and NoBackend errors to windows code (phillip couto)
    • Update dependencies: (brotskydotcom)
      • secret-service from 1.1.1 to 2.0.2
      • security-framework from 0.4.2 to 2.4.2
    • Update CI/tests, readme (brotskydotcom)

    v0.10.2

    • yanked, release snafu

    v0.10.1

    Compare Source

    • update to secret-service 1.1.1

    v0.10.0

    • ability to access named keychains in macos (nagasunilt)

    v0.9.0

    • upgrade security-framework 0.3.0 -> 0.4.2
    • upgrade secret-service 1.0.0 -> 1.1.0 (updates hkdf dep, fixes error handling related to missing collection)

    v0.8.0

    Compare Source

    • Upgrade to winapi 0.3 and removes advapi32-sys from windows.
    • Upgrades to edition 2018
    • Formats everything to 1.40
    • Removes mem::uninitialized from windows.

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate dirs to v4 - autoclosed

    Update Rust crate dirs to v4 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | dirs | dependencies | major | 2.0.2 -> 4.0.0 |


    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate clap to v4 - autoclosed

    Update Rust crate clap to v4 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | major | ^2.29.0 -> ^4.0.18 |


    Release Notes

    clap-rs/clap

    v4.0.18

    Compare Source

    Fixes
    • (derive) Allow #[command(skip)] to also work with enum variants with a value

    v4.0.17

    Compare Source

    Fixes
    • Allow using Arg::last(true) with Arg::value_hint(ValueHint::CommandWithArguments)

    v4.0.16

    Compare Source

    Fixes
    • Arg::exclusive(true) should not be exclusive with the argument's own ArgGroup

    v4.0.15

    Compare Source

    Fixes
    • (error) Don't suggest -- when it doesn't help
    • (error) Be more consistent in quoting, punctuation, and indentation in errors

    v4.0.14

    Compare Source

    Fixes
    • Only put ArgGroup in ArgMatches whenΒ explicitly specified, fixing derives handling of option-flattened fields (#​4375)

    v4.0.13

    Compare Source

    Features
    • (derive) Allow () for fields to mean "don't read" (#​4371)

    v4.0.12

    Compare Source

    Features
    • Added TypedValueParser::try_map for when adapting an existing TypedValueParser can fail
    • (error) Create errors like clap with Error::new, Error::with_cmd, and Error::insert

    v4.0.11

    Compare Source

    Fixes
    • (help) Fix wrapping calculations with ANSI escape codes

    v4.0.10

    Compare Source

    Features

    v4.0.9

    Compare Source

    Fixes
    • (derive) Process doc comments for #[command(subcommand)] like in clap v3

    v4.0.8

    Compare Source

    Fixes
    • (derive) Remove a low-value assert preventing defaulting Help and Version actions

    v4.0.7

    Compare Source

    Features
    Fixes
    • (derive) Support #[group(skip)] on Parser derive
    • (derive) Tell users about implicit arg groups when running into group name conflicts
    • (error) Don't report unrelated groups in conflict or requires errors

    v4.0.6

    Compare Source

    Features

    v4.0.5

    Compare Source

    v4.0.4

    Compare Source

    Fixes
    • (error) Specialize the self-conflict error to look like clap v3

    v4.0.3

    Compare Source

    Fixes
    • (error) Quote literals consistently
    • (error) Stylize escape (--) suggestions
    • (error) Format help flag as a literal

    v4.0.2

    Compare Source

    Fixes
    • (parser) SetFalse should conflict with itself like SetTrue and Set
    • (parser) Allow one-off overrides

    v4.0.1

    Compare Source

    Fixes
    • (derive) Allow #[command(skip)] to also work with enum variants with a value

    v4.0.0

    Compare Source

    Highlights

    Arg::num_args(range)

    Clap has had several ways for controlling how many values will be captured without always being clear on how they interacted, including

    • Arg::multiple_values(true)
    • Arg::number_of_values(4)
    • Arg::min_values(2)
    • Arg::max_values(20)
    • Arg::takes_value(true)

    These have now all been collapsed into Arg::num_args which accepts both single values and ranges of values. num_args controls how many raw arguments on the command line will be captured as values per occurrence and independent of value delimiters.

    See Issue 2688 for more background.

    Polishing Help

    Clap strives to give a polished CLI experience out of the box with little ceremony. With some feedback that has accumulated over time, we took this release as an opportunity to re-evaluate our --help output to make sure it is meeting that goal.

    In doing this evaluation, we wanted to keep in mind:

    • Whether other CLIs had ideas that make sense to apply
    • Providing an experience that fits within the rest of applications and works across all shells

    Before:

    git
    A fictional versioning CLI
    
    USAGE:
        git <SUBCOMMAND>
    
    OPTIONS:
        -h, --help    Print help information
    
    SUBCOMMANDS:
        add      adds things
        clone    Clones repos
        help     Print this message or the help of the given subcommand(s)
        push     pushes things
        stash
    

    After:

    A fictional versioning CLI
    
    Usage: git <COMMAND>
    
    Commands:
      clone  Clones repos
      push   pushes things
      add    adds things
      stash
      help   Print this message or the help of the given subcommand(s)
    
    Options:
      -h, --help  Print help information
    
    • name/version header was removed because we couldn't justify the space it occupied when
      • Usage already includes the name
      • --version is available for showing the same thing (if the program has a version set)
    • Usage was dropped to one line to save space
    • Focus is put on the subcommands
    • Headings are now Title case
    • The more general term "command" is used rather than being explicit about being "subcommands"
    • The output is more dense with the expectation that it won't affect legibility but will allow more content
    • We've moved to a more neutral palette for highlighting elements (not highlighted above)

    In talking to users, we found some that liked clap's man-like experience. When deviating from this, we are making the assumption that those are more power users and that the majority of users wouldn't look as favorably on being consistent with man.

    See Issue 4132 for more background.

    More Dynamicism

    Clap's API has focused on &str for performance but this can make dealing with owned data difficult, like #[arg(default_value_t)] generating a String from the default value.

    Additionally, to avoid ArgMatches from borrowing (and for some features we decided to forgo), clap took the &str argument IDs and hashed them. This prevented us from providing a usable API for iterating over existing arguments.

    Now clap has switched to a string newtype that gives us the flexibility to decide whether to use &'static str, Cow<'static, str> for fast dynamic behavior, or Box<str> for dynamic behavior with small binary size.

    As an extension of that work, you can now call ArgMatches::ids to iterate over the arguments and groups that were found when parsing. The newtype Id was used to prevent some classes of bugs and to make it easier to understand when opaque Ids are used vs user-visible strings.

    Clearing Out Deprecations

    Instead of doing all development on clap 4.0.0, we implemented a lot of new features during clap 3's development, deprecating the old API while introducing the new API, including:

    • Replacing the implicit behavior for args when parsing them with ArgAction
    • Replacing various one-off forms of value validation with the ValueParser API
      • Allowing derives to automatically do the right thing for PathBuf (allowing invalid UTF-8)
    • Replacing AppSettings and ArgSettings enums with getters/setters
    • Clarifying terms and making them more consistent
    Migrating

    Steps:

    1. Upgrade to v3 if you haven't already
    2. Add CLI tests (including example below), -h and --help output at a minimum (recommendation: trycmd for snapshot testing)
    3. If using Builder API: Explicitly set the arg.action(ArgAction::...) on each argument (StoreValue for options and IncOccurrences for flags)
    4. Run cargo check --features clap/deprecated and resolve all deprecation warnings
    5. Upgrade to v4
    6. Update feature flags
    • If default-features = false, run cargo add clap -F help,usage,error-context
    • Run cargo add clap -F wrap_help unless you want to hard code line wraps
    1. Resolve compiler errors
    2. Resolve behavior changes (see "subtle changes" under BREAKING CHANGES)
    3. At your leisure: resolve new deprecation notices

    Example test (derive):

    
    #[derive(clap::Parser)]
    struct Cli {
        ...
    }
    
    #[test]
    fn verify_cli() {
        use clap::CommandFactory;
        Cli::command().debug_assert()
    }
    

    Example test (builder):

    fn cli() -> clap::Command {
        ...
    }
    
    #[test]
    fn verify_cli() {
        cli().debug_assert();
    }
    

    Note: the idiomatic / recommended way of specifying different types of args in the Builder API has changed:

    Before

    .arg(Arg::new("flag").long("flag"))  # --flag
    .arg(Arg::new("option").long("option").takes_value(true))  # --option <option>
    

    After:

    .arg(Arg::new("flag").long("flag").action(ArgAction::SetTrue))  # --flag
    .arg(Arg::new("option").long("option"))  # --option <option>
    

    In particular, num_args (the replacement for takes_value) will default appropriately from the ArgAction and generally only needs to be set explicitly for the other num_args use cases.

    Breaking Changes

    Subtle changes (i.e. compiler won't catch):

    • arg! now sets one of (#​3795):
      • ArgAction::SetTrue, requiring ArgMatches::get_flag instead of ArgMatches::is_present
      • ArgAction::Count, requiring ArgMatches::get_count instead of ArgMatches::occurrences_of
      • ArgAction::Set, requiring ArgMatches::get_one instead of ArgMatches::value_of
      • ArgAction::Append, requiring ArgMatches::get_many instead of ArgMatches::values_of
    • ArgAction::Set, ArgAction::SetTrue, and Arg::Action::SetFalse now conflict by default to be like ArgAction::StoreValue and ArgAction::IncOccurrences, requiring cmd.args_override_self(true) to override instead (#​4261)
    • By default, an Args default action is ArgAction::Set, rather than ArgAction::IncOccurrence to reduce confusing magic through consistency (#​2687, #​4032, see also #​3977)
    • mut_arg can no longer be used to customize help and version arguments, instead disable them (Command::disable_help_flag, Command::disable_version_flag) and provide your own (#​4056)
    • Removed lifetimes from Command, Arg, ArgGroup, and PossibleValue, assuming 'static. string feature flag will enable support for Strings (#​1041, #​2150, #​4223)
    • arg!(--flag <value>) is now optional, instead of required. Add .required(true) at the end to restore the original behavior (#​4206)
    • Added default feature flags, help, usage and error-context, requiring adding them back in if default-features = false (#​4236)
    • (parser) Always fill in "" argument for external subcommands to make it easier to distinguish them from built-in commands (#​3263)
    • (parser) Short flags now have higher precedence than hyphen values with Arg::allow_hyphen_values, to be consistent with Command::allow_hyphen_values (#​4187)
    • (parser) Arg::value_terminator must be its own argument on the CLI rather than being in a delimited list (#​4025)
    • (help) Line wrapping of help is now behind the existing wrap_help feature flag, either enable it or hard code your wraps (#​4258)
    • (help) Make DeriveDisplayOrder the default and removed the setting. To sort help, set next_display_order(None) (#​2808)
    • (help) Subcommand display order respects Command::next_display_order instead of DeriveDisplayOrder and using its own initial display order value (#​2808)
    • (help) Subcommands are now listed before arguments. To get the old behavior, see Command::help_template (#​4132)
    • (help) Help headings are now title cased, making any user-provided help headings inconsistent. To get the old behavior, see Command::help_template, Arg::help_heading, and Command::subcommand_help_heading (#​4132)
    • (help) "Command" is used as the section heading for subcommands and COMMAND for the value name. To get the old behavior, see Command::subcommand_help_heading and Arg::subcommand_value_name (#​4132, #​4155)
    • (help) Whitespace in help output is now trimmed to ensure consistency regardless of how well a template matches the users needs. (#​4132, #​4156)
    • (help) name/version/author are removed by default from help output. To get the old behavior, see Command::help_template. (#​4132, #​4160)
    • (help) Indentation for second-line usage changed. (#​4132, #​4188)
    • (env) Parse --help and --version like any ArgAction::SetTrue flag (#​3776)
    • (derive) Leave Arg::id as verbatim casing, requiring updating of string references to other args like in conflicts_with or requires (#​3282)
    • (derive) Doc comments for ValueEnum variants will now show up in --help (#​3312)
    • (derive) When deriving Args, and ArgGroup is created using the type's name, reserving it for future use (#​2621, #​4209)
    • (derive) next_help_heading can now leak out of a #[clap(flatten)], like all other command settings (#​4222)

    Easier to catch changes:

    • Looking up a group in ArgMatches now returns the arg Ids, rather than the values to reduce overhead and offer more flexibility. (#​4072)
    • Changed Arg::number_of_values (average-across-occurrences) to Arg::num_args (per-occurrence) (raw CLI args, not parsed values) (#​2688, #​4023)
      • num_args(0) no longer implies takes_value(true).multiple_values(true) (#​4023)
      • num_args(1) no longer implies multiple_values(true) (#​4023)
      • Does not check default or env values, only what the user explicitly passes in (#​4025)
      • No longer terminates on delimited values (#​4025)
    • Replace Arg::min_values (across all occurrences) with Arg::num_args(N..) (per occurrence) to reduce confusion over different value count APIs (#​4023)
    • Replace Arg::max_values (across all occurrences) with Arg::num_args(1..=M) (per occurrence) to reduce confusion over different value count APIs (#​4023)
    • Replace Arg::multiple_values(true) with Arg::num_args(1..) and Arg::multiple_values(false) with Arg::num_args(0) to reduce confusion over different value count APIs (#​4023)
    • Replace Arg::takes_value(true) with Arg::num_args(1) and Arg::takes_value(false) with Arg::num_args(0) to reduce confusion over different value count APIs
    • Remove Arg::require_value_delimiter, either users could use Arg::value_delimiter or implement a custom parser with TypedValueParser as it was mostly to make multiple_values(true) act like multiple_values(false) and isn't needed anymore (#​4026)
    • Arg::new("help") and Arg::new("version") no longer implicitly disable the built-in flags and be copied to all subcommands, instead disable the built-in flags (Command::disable_help_flag, Command::disable_version_flag) and mark the custom flags as global(true). (#​4056)
    • Arg::short('h') no longer implicitly disables the short flag for help, instead disable the built-in flags (Command::disable_help_flag, Command::disable_version_flag) provide your own Arg::new("help").long("help").action(ArgAction::Help).global(true). (#​4056)
    • ArgAction::SetTrue and ArgAction::SetFalse now prioritize Arg::default_missing_value over their standard behavior (#​4000)
    • Changed Arg::requires_ifs and Arg::default_value*_ifs* to taking an ArgPredicate, removing ambiguity with None when accepting owned and borrowed types (#​4084)
    • Removed PartialEq and Eq from Command so we could change external subcommands to use a ValueParser (#​3990)
    • Various Arg, Command, and ArgGroup calls were switched from accepting &[] to [] via IntoIterator to be more flexible (#​4072)
    • Arg::short_aliases and other builder functions that took &[] need the & dropped (#​4081)
    • ErrorKind and Result moved into the error module
    • ErrorKind::EmptyValue replaced with ErrorKind::InvalidValue to remove an unnecessary special case (#​3676, #​3968)
    • ErrorKind::UnrecognizedSubcommand replaced with ErrorKind::InvalidSubcommand to remove an unnecessary special case (#​3676)
    • Changed the default type of allow_external_subcommands from String to OsString as that is less likely to cause bugs in user applications (#​3990)
    • (help) Command::render_usage now returns a StyledStr (#​4248)
    • (derive) Changed the default for arguments from parse to value_parser, removing parse support (#​3827, #​3981)
      • #[clap(value_parser)] and #[clap(action)] are now redundant
    • (derive) subcommand_required(true).arg_required_else_help(true) is set instead of SubcommandRequiredElseHelp to give more meaningful errors when subcommands are missing and to reduce redundancy (#​3280)
    • (derive) Remove arg_enum attribute in favor of value_enum to match the new name (we didn't have support in v3 to mark it deprecated) (#​4127)
    • (parser) Assert when the CLI looksup an unknown args when external subcommand support is enabled to help catch bugs (#​3703)
    • (assert) Sometimes Arg::default_missing_value didn't require num_args(0..=N), now it does (#​4023)
    • (assert) Leading dashes in Arg::long are no longer allowed (#​3691)
    • (assert) Disallow more value_names than num_args (#​2695)
    • (assert) Always enforce that version is specified when the ArgAction::Version is used
    • (assert) Add missing #[track_caller]s to make it easier to debug asserts
    • (assert) Ensure overrides_with IDs are valid
    • (assert) Ensure no self-overrides_with now that Actions replace it
    • (assert) Ensure subcommand names are not duplicated
    • (assert) Assert on mut_arg receiving an invalid arg ID or mut_subcommand receiving an invalid command name
    Compatibility

    MSRV is now 1.60.0

    Deprecated

    • Arg::use_value_delimiter in favor of Arg::value_delimiter to avoid having multiple ways of doing the same thing
    • Arg::requires_all in favor of Arg::requires_ifs now that it takes an ArgPredicate to avoid having multiple ways of doing the same thing
    • Arg::number_of_values in favor of Arg::num_args to clarify semantic differences
    • default_value_os, default_values_os, default_value_if_os, and default_value_ifs_os as the non _os variants now accept either a str or an OsStr (#​4141)
    • Arg::env_os in favor of Arg::env
    • Command::dont_collapse_args_in_usage is now the default (#​4151)
    • Command::trailing_var_arg in favor of Arg::trailing_var_arg to make it clearer which arg it is meant to apply to (#​4187)
    • Command::allow_hyphen_values in favor of Arg::allow_hyphen_values to make it clearer which arg it is meant to apply to (#​4187)
    • Command::allow_negative_numbers in favor of Arg::allow_negative_numbers to make it clearer which arg it is meant to apply to (#​4187)
    • (help) Deprecated Command::write_help and Command::write_long_help in favor of Command::render_help and Command::render_long_help (#​4248)
    • (derive) structopt and clap attributes in favor of the more specific command, arg, and value to open the door for more features and clarify relationship to the builder (#​1807, #​4180)
    • (derive) #[clap(value_parser)] and #[clap(action)] defaulted attributes (its the default) (#​3976)

    Behavior Changes

    • (help) With wrap_help feature, if the terminal size cannot be determined, LINES and COLUMNS variables are used (#​4186)
    Features
    • Arg::num_args now accepts ranges, allowing setting both the minimum and maximum number of values per occurrence (#​2688, #​4023)
    • Allow non-bool value_parsers for ArgAction::SetTrue / ArgAction::SetFalse (#​4092)
    • Add From<&OsStr>, From<OsString>, From<&str>, and From<String> to value_parser! (#​4257)
    • Allow resetting most builder methods
    • Can now pass runtime generated data to Command, Arg, ArgGroup, PossibleValue, etc without managing lifetimes with the string feature flag (#​2150, #​4223)
    • New default error-context, help and usage feature flags that can be turned off for smaller binaries (#​4236)
    • Added StyledStr::ansi() to Display with ANSI escape codes (#​4248)
    • (error) Error::apply for changing the formatter for dropping binary size (#​4111)
    • (error) Error::renderfor formatting the error into a StyledStr
    • (help) Show PossibleValue::help in long help (--help) (#​3312)
    • (help) New {tab} variable for Command::help_template (#​4161)
    • (help) Command::render_help and Command::render_long_help for formatting the error into a StyledStr (#​3873, #​4248)
    • (help) Command::render_usage now returns a StyledStr (#​4248)
    Fixes
    • Verify required is not used with conditional required settings (#​3660)
    • Replaced cmd.allow_invalid_for_utf8_external_subcommands with cmd.external_subcommand_value_parser (#​3733)
    • Arg::default_missing_value now applies per occurrence rather than if a value is missing across all occurrences (#​3998)
    • arg!(--long [value]) to accept 0..=1 per occurrence rather than across all occurrences, making it safe to use with ArgAction::Append (#​4001)
    • Allow OsStrs for Arg::{required_if_eq,required_if_eq_any,required_if_eq_all} (#​4084)
    • (help) With wrap_help feature, if the terminal size cannot be determined, LINES and COLUMNS variables are used (#​4186)
    • (help) Use Command::display_name in the help title rather than Command::bin_name
    • (help) Show when a flag is ArgAction::Count by adding an ... (#​4003)
    • (help) Use a more neutral palette for coloring (#​4132, #​4117)
    • (help) Don't rely on ALL CAPS for help headers (#​4132, #​4123)
    • (help) List subcommands first, focusing the emphasis on them (#​4132, #​4125)
    • (help) Do not include global args in cmd help help (#​4131)
    • (help) Use [positional] in list when relevant (#​4144)
    • (help) Show all [positional] in usage (#​4151)
    • (help) Polish up subcommands by referring to them as commands (#​4132, #​4155)
    • (help) Trim extra whitespace to avoid artifacts from different uses of templates (#​4132, #​4156)
    • (help) Hint to the user the difference between -h / --help when applicable (#​4132, #​4159)
    • (help) Shorten help by eliding name/version/author (#​4132, #​4160)
    • (help) When short help is long enough to activate next_line_help, don't add blank lines (#​4132, #​4190)
    • (help) Make help output more dense (reducing horizontal whitespace) (#​4132, #​4192)
    • (help) Separate subcommand flags with "," like option flags (#​4232, #​4235)
    • (help) Quote the suggested help flag (#​4220)
    • (version) Use Command::display_name rather than Command::bin_name (#​3966)
    • (parser) Always fill in "" argument for external subcommands (#​3263)
    • (parser) Short flags now have higher precedence than hyphen values with Arg::allow_hyphen_values, like Command::allow_hyphen_values (#​4187)
    • (parser) Prefer InvalidSubcommand over UnknownArgument in more cases (#​4219)
    • (derive) Detect escaped external subcommands that look like built-in subcommands (#​3703)
    • (derive) Leave Arg::id as verbatim casing (#​3282)
    • (derive) Default to #[clap(value_parser, action)] instead of #[clap(parse)] (#​3827)

    v3.2.22

    Compare Source

    [3.2.22] - 2022-09-16

    Fixes
    • Unify dependencies on terminal_size to the 0.2 release

    v3.2.21

    Compare Source

    [3.2.21] - 2022-09-12

    Features
    • TypedValueParser::map to allow reusing existing value parsers for other purposes

    v3.2.20

    Compare Source

    [3.2.20] - 2022-09-02
    Features
    • ArgMatches::get_count help for ArgAction::Count
    • ArgMatches::get_flag help for ArgAction::SetTrue / ArgAction::SetFalse

    v3.2.19

    Compare Source

    [3.2.19] - 2022-08-30
    Fixes
    • (help) Ensure required arguments for parent commands aren't shown in their subcommands when using args_conflicts_with_subcommand

    v3.2.18

    Compare Source

    Fixes
    • (help) Command::print_help now respects Command::colored_help
    • (derive) Improved error messages

    v3.2.17

    Compare Source

    Fixes
    • (derive) Expose #[clap(id = ...)] attribute to match Arg's latest API

    v3.2.16

    Compare Source

    Fixes
    • Ensure required arguments appear in errors when they are also members of a group (#​4004)

    v3.2.15

    Compare Source

    Features
    • (derive) New default_values_t and default_values_os_t attributes

    v3.2.14

    Compare Source

    Fixes
    • A multiple_values positional followed by another positional now works with multiple flags

    v3.2.13

    Compare Source

    Documentation
    • Pulled in tutorials, cookbook, and derive reference into rustdoc

    v3.2.12

    Compare Source

    Fixes
    • Allow an arg to declare a conflict with a group

    v3.2.11

    Compare Source

    Features
    • Added Arg::get_all_short_aliaes and Arg::get_all_aliases

    v3.2.10

    Compare Source

    Fixes
    • Loosen lifetime on Command::mut_subcommand

    v3.2.8

    Compare Source

    Features
    • Added Command::mut_subcommand to mirror Command::mut_arg

    v3.2.7

    Compare Source

    Fixes
    • Global arguments should override env-sourced arguments

    v3.2.6

    Compare Source

    Fixes
    • Don't panic when parsing --=

    v3.2.5

    Compare Source

    Fixes
    • (derive) Fix regression with #[clap(default_value_os_t ...)] introduced in v3.2.3

    v3.2.4

    Compare Source

    Fixes
    • (derive) Provide more clearer deprecation messages for #[clap(parse)] attribute (#​3832)

    v3.2.3

    Compare Source

    Fixes
    • Moved deprecations to be behind the deprecated Cargo.toml feature (#​3830)
      • For now, it is disabled by default though we are considering enabling it by default as we release the next major version to help draw attention to the deprecation migration path

    v3.2.2

    Compare Source

    Fixes
    • (derive) Improve the highlighted code for deprecation warnings

    gated behind unstable-v4

    • (derive) Default to #[clap(value_parser, action)] instead of #[clap(parse)] (#​3827)

    v3.2.1

    Compare Source

    Fixes
    • (help) Command::print_help now respects Command::colored_help
    • (derive) Improved error messages

    v3.2.0

    Compare Source

    Compatibility

    MSRV is now 1.56.0 (#​3732)

    Behavior

    • Defaults no longer satisfy required and its variants (#​3793)
    • When misusing ArgMatches::value_of and friends, debug asserts were turned into panics

    Moving (old location deprecated)

    • clap::{PossibleValue, ValueHint} to clap::builder::{PossibleValue, ValueHint}
    • clap::{Indices, OsValues, ValueSource, Values} to clap::parser::{Indices, OsValues, ValueSource, Values}
    • clap::ArgEnum to clap::ValueEnum (#​3799)

    Replaced

    • Arg::allow_invalid_utf8 with Arg::value_parser(value_parser!(PathBuf)) (#​3753)
    • Arg::validator / Arg::validator_os with Arg::value_parser (#​3753)
    • Arg::validator_regex with users providing their own builder::TypedValueParser (#​3756)
    • Arg::forbid_empty_values with builder::NonEmptyStringValueParser / builder::PathBufValueParser (#​3753)
    • Arg::possible_values with Arg::value_parser([...]), builder::PossibleValuesParser, or builder::EnumValueParser (#​3753)
    • Arg::max_occurrences with arg.action(ArgAction::Count).value_parser(value_parser!(u8).range(..N)) for flags (#​3797)
    • Arg::multiple_occurrences with ArgAction::Append or ArgAction::Count though positionals will need Arg::multiple_values (#​3772, #​3797)
    • Command::args_override_self with ArgAction::Set (#​2627, #​3797)
    • AppSettings::NoAutoVersion with ArgAction or Command::disable_version_flag (#​3800)
    • AppSettings::NoHelpVersion with ArgAction or Command::disable_help_flag / Command::disable_help_subcommand (#​3800)
    • ArgMatches::{value_of, value_of_os, value_of_os_lossy, value_of_t} with ArgMatches::{get_one,remove_one} (#​3753)
    • ArgMatches::{values_of, values_of_os, values_of_os_lossy, values_of_t} with ArgMatches::{get_many,remove_many} (#​3753)
    • ArgMatches::is_valid_arg with ArgMatches::{try_get_one,try_get_many} (#​3753)
    • ArgMatches::occurrences_of with ArgMatches::value_source or ArgAction::Count (#​3797)
    • ArgMatches::is_present with ArgMatches::contains_id or ArgAction::SetTrue (#​3797)
    • ArgAction::StoreValue with ArgAction::Set or ArgAction::Append (#​3797)
    • ArgAction::IncOccurrences with ArgAction::SetTrue or ArgAction::Count (#​3797)
    • (derive) #[clap(parse(...))] replaced with: (#​3589, #​3794)
      • For default parsers (no parse attribute), deprecation warnings can be silenced by opting into the new behavior by adding either #[clap(action)] or #[clap(value_parser)] (ie requesting the default behavior for these attributes). Alternatively, the unstable-v4 feature changes the default away from parse to action/value_parser.
      • For #[clap(parse(from_flag))] replaced with #[clap(action = ArgAction::SetTrue)] (#​3794)
      • For #[clap(parse(from_occurrences))] replaced with #[clap(action = ArgAction::Count)] though the field's type must be u8 (#​3794)
      • For #[clap(parse(from_os_str)] for PathBuf, replace it with #[clap(value_parser)] (as mentioned earlier this will call value_parser!(PathBuf) which will auto-select the right ValueParser automatically).
      • For #[clap(parse(try_from_str = ...)], replace it with #[clap(value_parser = ...)]
      • For most other cases, a type implementing TypedValueParser will be needed and specify it with #[clap(value_parser = ...)]
    Features
    • Parsed, typed arguments via Arg::value_parser / ArgMatches::{get_one,get_many} (#​2683, #​3732)
      • Several built-in TypedValueParsers available with an API open for expansion
      • value_parser!(T) macro for selecting a parser for a given type (#​3732) and open to expansion via the ValueParserFactory trait (#​3755)
      • [&str] is implicitly a value parser for possible values
      • All ArgMatches getters do not assume required arguments (#​2505)
      • Add ArgMatches::remove_* variants to transfer ownership
      • Add ArgMatches::try_* variants to avoid panics for developer errors (#​3621)
      • Add a get_raw to access the underlying OsStrs
      • PathBuf value parsers imply ValueHint::AnyPath for completions (#​3732)
    • Explicit control over parsing via Arg::action (#​3774)
      • ArgAction::StoreValue: existing takes_value(true) behavior
      • ArgAction::IncOccurrences: existing takes_value(false) behavior
      • ArgAction::Help: existing --help behavior
      • ArgAction::Version: existing --version behavior
      • ArgAction::Set: Overwrite existing values (like Arg::multiple_occurrences mixed with Command::args_override_self) (#​3777)
      • ArgAction::Append: like Arg::multiple_occurrences (#​3777)
      • ArgAction::SetTrue: Treat --flag as --flag=true (#​3775)
        • Implies Arg::default_value("false") (#​3786)
        • Parses Arg::env via Arg::value_parser
      • ArgAction::SetFalse: Treat --flag as --flag=false (#​3775)
        • Implies Arg::default_value("true") (#​3786)
        • Parses Arg::env via Arg::value_parser
      • ArgAction::Count: Treat --flag --flag --flag as --flag=1 --flag=2 --flag=3 (#​3775)
        • Implies Arg::default_value("0") (#​3786)
        • Parses Arg::env via Arg::value_parser
    • (derive) Opt-in to new Arg::value_parser / Arg::action with either #[clap(value_parser)] (#​3589, #​3742) / #[clap(action)] attributes (#​3794)
    • Command::multicall is now stable for busybox-like programs and REPLs (#​2861, #​3684)
    • ArgMatches::{try_,}contains_id for checking if there are values for an argument that mirrors the new get_{one,many} API
    Fixes
    • Don't correct argument id in default_value_ifs_os(#​3815)

    parser

    • Set ArgMatches::value_source and ArgMatches::occurrences_of for external subcommands (#​3732)
    • Use value delimiter for Arg::default_missing_values (#​3761, #​3765)
    • SplitArg::default_value / Arg::env on value delimiters independent of whether -- was used (#​3765)
    • Allow applying defaults to flags (#​3294, 3775)
    • Defaults no longer satisfy required and its variants (#​3793)

    v3.1.18

    Compare Source

    Fixes
    • Fix deprecated arg_enum! for users migrating to clap3 (#​3717)
    • Verify all required_unless_present_all arguments exist
    • Verify group members exist before processing group members (#​3711)
    • (help) Use ... when not enough value_names are supplied

    gated behind unstable-v4

    • Verify required is not used with conditional required settings (#​3660)
    • Disallow more value_names than number_of_values (#​2695)
    • (parser) Assert on unknown args when using external subcommands (#​3703)
    • (parser) Always fill in "" argument for external subcommands (#​3263)
    • (derive) Detect escaped external subcommands that look like built-in subcommands (#​3703)
    • (derive) Leave Arg::id as verbatim casing (#​3282)

    v3.1.17

    Compare Source

    Fixes
    • Allow value names for arg! macro to have dashes when quoted, like longs

    v3.1.16

    Compare Source

    Fixes
    • (parser) Arg::exclusive overrides Arg::required, like other conflicts
    • (error) Don't duplicate arguments in usage
    • (error) Don't show hidden arguments in conflict error usage
    • (help) New help_template variable {name} to fix problems with {bin}
    • (help) Don't wrap URLs

    gated behind unstable-v4

    • Leading dashes in Arg::long are no longer allowed
    • (help) Use Command::display_name in the help title rather than Command::bin_name

    v3.1.15

    Compare Source

    Fixes
    • (error) Render actual usage for unrecognized subcommands
    • (multicall) Improve bad command error
    • (multicall) Always require a multicall command
    • (multicall) Disallow arguments on multicall parent command
    • (multicall) More consistent with rest of clap errors

    v3.1.14

    Compare Source

    Fixes
    • Panic when calling Command::build with a required positional argument nested several layers in subcommands

    v3.1.13

    Compare Source

    Fixes
    • Help subcommand and Command::write_help now report required arguments in usage in more circumstances
    • Unknown subcommand for help subcommand flag now reports an error with more context
    • More details reported when using debug feature
    • Allow disabling color feature with debug feature enabled

    v3.1.12

    Compare Source

    Fixes
    • Regression in 3.1.11 where the (output) streams were crossed

    v3.1.11

    Compare Source

    Fixes
    • Implied conflicts override Arg::required, making the behavior consistent with how we calculate conflicts for error reporting
    • Members of a mutually exclusive ArgGroup override Arg::required, making the behavior consistent with how we calculate conflicts for error reporting
    • Arg::overrides_with always override Arg::required, not just when the parser processes an override

    v3.1.10

    Compare Source

    Features
    • Expose Command::build for custom help generation or other command introspection needs

    v3.1.9

    Compare Source

    Fixes
    • Pin the clap_derive version so a compatible version is always used with clap

    v3.1.8

    Compare Source

    Fixes
    • Add Debug impls to more types

    v3.1.7

    Compare Source

    Fixes
    • (derive) Abort, rather than ignore, when deriving ArgEnum with non-unit unskipped variants

    v3.1.6

    Compare Source

    Fixes
    • Don't panic when validating delimited defaults (#​3541)
    • Make it clearer that cargo feature is needed
    • Documentation improvements

    v3.1.5

    Compare Source

    Fixes
    • Dependency upgrade

    v3.1.4

    Compare Source

    Features
    • (help) Show PossibleValue::help in long help (--help) (gated behind unstable-v4) (#​3312)

    v3.1.3

    Compare Source

    Fixes
    • Don't panic when validating delimited defaults (#​3514)

    v3.1.2

    Compare Source

    Fixes
    • (derive) Allow other attribute with a subcommand that has subcommands
    Documentation
    • (examples) List example topics
    • (derive) Clarify syntax and relation to builder API

    v3.1.1

    Compare Source

    Fixes
    • Fix deprecated arg_enum! for users migrating to clap3 (#​3717)
    • Verify all required_unless_present_all arguments exist
    • Verify group members exist before processing group members (#​3711)
    • (help) Use ... when not enough value_names are supplied

    gated behind unstable-v4

    • Verify required is not used with conditional required settings (#​3660)
    • Disallow more value_names than number_of_values (#​2695)
    • (parser) Assert on unknown args when using external subcommands (#​3703)
    • (parser) Always fill in "" argument for external subcommands (#​3263)
    • (derive) Detect escaped external subcommands that look like built-in subcommands (#​3703)
    • (derive) Leave Arg::id as verbatim casing (#​3282)

    v3.1.0

    Compare Source

    Compatibility

    Changes in behavior of note that are not guaranteed to be compatible across releases:

    • (help) help subcommand shows long help like --help, rather than short help (-h), deprecated clap::AppSettings::UseLongFormatForHelpSubcommand (#​3440)
    • (help) Pacman-style subcommands are now ordered the same as usage errors (#​3470)
    • (help) Pacman-style subcommands use standard alternate syntax in usage (#​3470)
    Deprecations
    • clap::Command is now preferred over clap::App ([#​3089](ht

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate rand to 0.8 - autoclosed

    Update Rust crate rand to 0.8 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | rand (source) | dependencies | minor | 0.7 -> 0.8 |


    Release Notes

    rust-random/rand

    v0.8.5

    Compare Source

    Fixes
    • Fix build on non-32/64-bit architectures (#​1144)
    • Fix "min_const_gen" feature for no_std (#​1173)
    • Check libc::pthread_atfork return value with panic on error (#​1178)
    • More robust reseeding in case ReseedingRng is used from a fork handler (#​1178)
    • Fix nightly: remove unused slice_partition_at_index feature (#​1215)
    • Fix nightly + simd_support: update packed_simd (#​1216)
    Rngs
    • StdRng: Switch from HC128 to ChaCha12 on emscripten (#​1142). We now use ChaCha12 on all platforms.
    Documentation

    v0.8.4

    Compare Source

    Additions
    • Use const-generics to support arrays of all sizes (#​1104)
    • Implement Clone and Copy for Alphanumeric (#​1126)
    • Add Distribution::map to derive a distribution using a closure (#​1129)
    • Add Slice distribution (#​1107)
    • Add DistString trait with impls for Standard and Alphanumeric (#​1133)
    Other
    • Reorder asserts in Uniform float distributions for easier debugging of non-finite arguments (#​1094, #​1108)
    • Add range overflow check in Uniform float distributions (#​1108)
    • Deprecate rngs::adapter::ReadRng (#​1130)

    v0.8.3

    Compare Source

    Fixes
    • Fix no-std + alloc build by gating choose_multiple_weighted on std (#​1088)

    v0.8.2

    Compare Source

    Fixes
    • Fix panic in UniformInt::sample_single_inclusive and Rng::gen_range when providing a full integer range (eg 0..=MAX) (#​1087)

    v0.8.1

    Compare Source

    Other
    • Enable all stable features in the playground (#​1081)

    v0.8.0

    Compare Source

    Platform support
    • The minimum supported Rust version is now 1.36 (#​1011)
    • getrandom updated to v0.2 (#​1041)
    • Remove wasm-bindgen and stdweb feature flags. For details of WASM support, see the getrandom documentation. (#​948)
    • ReadRng::next_u32 and next_u64 now use little-Endian conversion instead of native-Endian, affecting results on Big-Endian platforms (#​1061)
    • The nightly feature no longer implies the simd_support feature (#​1048)
    • Fix simd_support feature to work on current nightlies (#​1056)
    Rngs
    • ThreadRng is no longer Copy to enable safe usage within thread-local destructors (#​1035)
    • gen_range(a, b) was replaced with gen_range(a..b). gen_range(a..=b) is also supported. Note that a and b can no longer be references or SIMD types. (#​744, #​1003)
    • Replace AsByteSliceMut with Fill and add support for [bool], [char], [f32], [f64] (#​940)
    • Restrict rand::rngs::adapter to std (#​1027; see also #​928)
    • StdRng: add new std_rng feature flag (enabled by default, but might need to be used if disabling default crate features) (#​948)
    • StdRng: Switch from ChaCha20 to ChaCha12 for better performance (#​1028)
    • SmallRng: Replace PCG algorithm with xoshiro{128,256}++ (#​1038)
    Sequences
    • Add IteratorRandom::choose_stable as an alternative to choose which does not depend on size hints (#​1057)
    • Improve accuracy and performance of IteratorRandom::choose (#​1059)
    • Implement IntoIterator for IndexVec, replacing the into_iter method (#​1007)
    • Add value stability tests for seq module (#​933)
    Misc
    Distributions
    • Alphanumeric samples bytes instead of chars (#​935)
    • Uniform now supports char, enabling rng.gen_range('A'..='Z') (#​1068)
    • Add UniformSampler::sample_single_inclusive (#​1003)
    Weighted sampling
    • Implement weighted sampling without replacement (#​976, #​1013)
    • rand::distributions::alias_method::WeightedIndex was moved to rand_distr::WeightedAliasIndex. The simpler alternative rand::distribution::WeightedIndex remains. (#​945)
    • Improve treatment of rounding errors in WeightedIndex::update_weights (#​956)
    • WeightedIndex: return error on NaN instead of panic (#​1005)
    Documentation
    • Document types supported by random (#​994)
    • Document notes on password generation (#​995)
    • Note that SmallRng may not be the best choice for performance and in some other cases (#​1038)
    • Use doc(cfg) to annotate feature-gated items (#​1019)
    • Adjust README (#​1065)

    v0.7.3

    Compare Source

    Fixes
    • The Bernoulli distribution constructors now reports an error on NaN and on denominator == 0. (#​925)
    • Use std::sync::Once to register fork handler, avoiding possible atomicity violation (#​928)
    • Fix documentation on the precision of generated floating-point values
    Changes
    • Unix: make libc dependency optional; only use fork protection with std feature (#​928)
    Additions
    • Implement std::error::Error for BernoulliError (#​919)

    v0.7.2

    Compare Source

    Fixes
    Additions
    • Unit tests for value stability of distributions added (#​888)

    v0.7.1

    Compare Source

    Yanked

    This release was yanked since it depends on rand_core::OsRng added in 0.5.1 but specifies a dependency on version 0.5.0 (#​890), causing a broken builds when updating from rand 0.7.0 without also updating rand_core.

    Fixes
    • Fix no_std behaviour, appropriately enable c2-chacha's std feature (#​844)
    • alloc feature in no_std is available since Rust 1.36 (#​856)
    • Fix or squelch issues from Clippy lints (#​840)
    Additions
    • Add a no_std target to CI to continuously evaluate no_std status (#​844)
    • WeightedIndex: allow adjusting a sub-set of weights (#​866)

    Configuration

    πŸ“… Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    This repository currently has no open or pending branches.

    Detected dependencies

    cargo
    Cargo.toml
    • base32 0.4.0
    • clap ^4.0.32
    • keyring ^1.2.0
    • totp-lite 2.0.0
    • rand ^0.8.5
    • rpassword ^7.2.0
    • rust-crypto 0.2.36
    • serde 1.0.152
    • serde_derive 1.0.152
    • serde_json 1.0.91
    • dirs ^4.0.0
    • ctrlc 3.2
    github-actions
    .github/workflows/build.yml
    • actions-rs/toolchain v1
    • actions/checkout v3
    • actions/cache v3
    .github/workflows/release.yml
    • actions/create-release v1
    .github/workflows/upload-release-assets.yml
    • actions-rs/toolchain v1
    • actions/checkout v3
    • actions/cache v3
    • actions/upload-release-asset v1.0.2

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
  • Thanks, I've been using this everyday for about a year

    Thanks, I've been using this everyday for about a year

    Just that β™₯

    I maintain some open source projects too, and I sometimes wonder if people are actually using my stuff. So here you are. I'm using and getting value from your work.

    opened by tombh 0
Releases(0.3.2)
Owner
German Lashevich
German Lashevich
Trustworthy encrypted command line authenticator app compatible with multiple backups.

cotp - command line totp authenticator I believe that security is of paramount importance, especially in this digital world. I created cotp because I

Reply 71 Dec 30, 2022
Decrypt your LUKS partition using a FIDO2 compatible authenticator

fido2luks This will allow you to unlock your LUKS encrypted disk with an FIDO2 compatible key. Note: This has only been tested under Fedora 31, Ubuntu

null 118 Dec 24, 2022
The simple password manager for geeks, built with Rust.

Rooster Rooster is a simple password manager for geeks (it works in the terminal). Rooster is made available free of charge. You can support its devel

Conrad Kleinespel 131 Dec 25, 2022
A simple password manager written in rust

Passman - A password manager written in rust. How to use?: USAGE: passman option Currently available options are: new - initalize passman with a new m

Strawkage 7 Aug 26, 2021
A simple password manager written in Rust

ripasso A simple password manager written in Rust. The root crate ripasso is a library for accessing and decrypting passwords stored in pass format (G

Joakim Lundborg 550 Dec 30, 2022
A password manager coded in rust

pasman A password manager coded in rust Install Dependency rust Shell git clone https://github.com/AMTitan/pasman.git cd pasman cargo build --release

Arthur Melton 4 Nov 8, 2021
The free password manager for power users

The free password manager for power users

null 312 Oct 22, 2022
A lightning-fast password generator and manager written in Rust

Passlane A lightning-fast password manager for the command line Features Generate passwords Place the generated password into the clipboard Save previ

Anssi Piirainen 4 Dec 15, 2022
A terminal-based password manager, generator, and importer/exporter (Firefox, Chrome) backed with a concurrent hashmap

rucksack A terminal-based password manager, generator, and importer/exporter (Firefox, Chrome) backed with a concurrent hashmap Features Password gene

null 6 Jan 18, 2023
A Password Manager Using age for Encryption

A Password Manager Using age for Encryption Contents Features Usage Install Import from pass How It Works Features It is inspired by pass. senior's fe

Retirement Home 3 Nov 2, 2023
Cross-platform atomic wait and wake (aka futex) functionality for Rust.

Cross platform atomic wait and wake (aka futex) functionality. This crate only supports functionality that's available on all of Linux, Windows, and m

Mara Bos 38 Dec 15, 2022
An implementation of the OPAQUE password-authenticated key exchange protocol

The OPAQUE key exchange protocol OPAQUE is an asymmetric password-authenticated key exchange protocol. It allows a client to authenticate to a server

Novi 178 Jan 9, 2023
Master Password in Pure Rust

Master Password β€’β€’β€’| This is the Rust version of the original found here. This can be used as a drop-in replacement for the reference C version, offer

Rust India 34 Apr 13, 2022
A Rust port of the password primitives used in Django Project.

Rust DjangoHashers A Rust port of the password primitives used in Django Project. Django's django.contrib.auth.models.User class has a few methods to

Ronaldo Ferreira 52 Nov 17, 2022
A safe implementation of the secure remote password authentication and key-exchange protocol (SRP), SRP6a and legacy are as features available.

Secure Remote Password (SRP 6 / 6a) A safe implementation of the secure remote password authentication and key-exchange protocol (SRP version 6a). Ver

Sven Assmann 10 Nov 3, 2022
Ruo is a dictionary-based password cracker written in rust πŸ¦€ .

Ruo is a dictionary-based password cracker written in rust ?? . The primary purpose is to crack weak hashes/commonly used passwords.

Asjid Kalam 10 Mar 6, 2022
A password entropy calculator.

paspio β€” pasvorta entropio A (naive) password entropy calculator. Refrain from using this as a sole measure of password strength, it should be used in

Aziz Ben Ali 3 Mar 8, 2022
Password-Authenticated Key Agreement protocols

RustCrypto: PAKEs Password-Authenticated Key Agreement protocols implementation. Warnings Crates in this repository have not yet received any formal c

Rust Crypto 81 Dec 5, 2022
Password hashing functions / KDFs

RustCrypto: Password Hashes Collection of password hashing algorithms, otherwise known as password-based key derivation functions, written in pure Rus

Rust Crypto 387 Dec 28, 2022