Skip to content

Commit

Permalink
[rust-crates] Bump argh to 0.1.4
Browse files Browse the repository at this point in the history
This updates argh to 0.1.4, which includes the following changes:

* 66e44a7 - Add myself to more authors lists (6 minutes ago) <Erick Tryzelaar>
* ce8ce29 - Add Cargo.lock to .gitignore (9 minutes ago) <Erick Tryzelaar>
* 567dc18 - Adding myself to the authors list (10 minutes ago) <Erick Tryzelaar>
* c2fc87d - Bump versions to 0.1.4 (10 minutes ago) <Erick Tryzelaar>
* 83785d1 - Use command base name not full path. (#44) (4 hours ago) <Matt Boetger>
*   d6abe82 - Merge pull request #64 from erickt/parse-errors (2 weeks ago) <Erick Tryzelaar>
|\
| * c728c85 - Fix quoting in errors when parsing arguments (2 weeks ago) <Erick Tryzelaar>
* |   14fc76d - Merge pull request #66 from erickt/remove-lock (2 weeks ago) <Erick Tryzelaar>
|\ \
| |/
|/|
| * e91274f - Remove lockfile (2 weeks ago) <Erick Tryzelaar>
|/
*   f3da6ae - Merge pull request #60 from elipsitz/support-option-delimiter (2 weeks ago) <Erick Tryzelaar>
|\
| * 9022148 - Add support for option delimiter "--" (3 weeks ago) <Eli Lipsitz>
| * 2517d3f - Run rustfmt to fix a pre-existing formatting issue (3 weeks ago) <Eli Lipsitz>
* | 8d9a82f - Merge pull request #49 from siyopao/fix-issue-45 (3 months ago) <Benjamin Brittain>
|\|
| * ee6521e - Add missing newline to error message (3 months ago) <Craig Pastro>
|/
*   507087f - Merge pull request #41 from benbrittain/kebab-case (4 months ago) <Benjamin Brittain>
|\
| * 5b0c45f - Allow kebab-case in long names (4 months ago) <Ben Brittain>
| * ae57b5c - update lockfile (4 months ago) <Ben Brittain>
|/
* e59f2c8 - fix default value error message (4 months ago) <Ben Brittain>
*   aae704e - Merge pull request #24 from foresterre/docs/fix-docsrs-badge-link (6 months ago) <Benjamin Brittain>
|\
| * 1fddf5a - Fix the source of the docs.rs badge link (6 months ago) <Martijn M.W. Gribnau>
|/
*   68e7363 - Merge pull request #23 from Atul9/add-cargo-fmt-to-github-actions (7 months ago) <Benjamin Brittain>
|\
| * 1f8930c - Add cargo fmt to github-actions config (7 months ago) <Atul Bhosale>
|/
*   bf49ee6 - Merge pull request #17 from fadeevab/docs-about-default (7 months ago) <Benjamin Brittain>
|\
| * 7d6cc74 - Update package docs from README (about default args) (7 months ago) <Alexander Fadeev>
|/
*   c1079ba - Merge pull request #16 from fadeevab/readme-examples-default-optional (7 months ago) <Benjamin Brittain>
|\
| * 1adb4e8 - Example and explanation about default and optional (7 months ago) <Alexander Fadeev>
|/
*   dad549b - Merge pull request #10 from MRedies/patch-1 (9 months ago) <Benjamin Brittain>
|\
| * 276fa2b - Confusing syntax highlighting in README.md (9 months ago) <Matthias Redies>
|/
*   737d298 - Merge pull request #8 from Atul9/cargo-fmt (9 months ago) <Ben Brittain>
|\
| * 7515ada - Format code using 'cargo fmt' (9 months ago) <Atul Bhosale>
|/
* 6e8c8f5 - Add rustfmt used for this project (9 months ago) <Benjamin Brittain>
* 154e4fe - Add badges to README (9 months ago) <Ben Brittain>
* 775c6bc - Update rust.yml (9 months ago) <Ben Brittain>
* f587921 - Update rust.yml (9 months ago) <Ben Brittain>
* 3ab931f - Add basic CI/CQ with GitHub actions (9 months ago) <Ben Brittain>
* 9bd8f0f - Add keywords (9 months ago) <Ben Brittain>
* e8a6b13 - Remove duplicate section in README (9 months ago) <Ben Brittain>
*   bac15ab - Merge pull request #5 from tshepang/patch-1 (9 months ago) <Ben Brittain>
|\
| * e5e0d6f - readme: highlight code, and reduce density, for 1 example (9 months ago) <Tshepang Lekhonkhobe>
|/
* ebfaa78 - Merge pull request #2 from jeremyBanks/patch-1 (9 months ago) <Ben Brittain>
* 5e702a1 - Link crates.io badge to crates.io page (9 months ago) <Jeremy Banks>

Change-Id: Iec1b6164fe477c7e7f0583273a405be1a87064f4
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/443703
Reviewed-by: George Kulakowski <kulakowski@google.com>
Testability-Review: George Kulakowski <kulakowski@google.com>
Commit-Queue: Erick Tryzelaar <etryzelaar@google.com>
  • Loading branch information
erickt authored and CQ Bot committed Oct 28, 2020
1 parent b3cc661 commit bef1eec
Show file tree
Hide file tree
Showing 15 changed files with 253 additions and 99 deletions.
32 changes: 16 additions & 16 deletions third_party/rust_crates/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ group("arc-swap") {
}

group("argh") {
deps = [ ":argh-v0_1_3" ]
deps = [ ":argh-v0_1_4" ]
}

if (!(current_os == "fuchsia")) {
Expand Down Expand Up @@ -987,40 +987,40 @@ rust_library("arc-swap-v0_4_4") {
]
}

rust_library("argh-v0_1_3") {
rust_library("argh-v0_1_4") {
crate_name = "argh"
crate_root = "//third_party/rust_crates/vendor/argh/src/lib.rs"
output_name = "argh-e6d3638980bc6cc2"
output_name = "argh-bd83e7fcbd154aa3"
configs -= [
"//build/config:rust_edition_2018",
"//build/config:rust_2018_idioms",
]

deps = []
deps += [ ":argh_derive-v0_1_1($host_toolchain)" ]
deps += [ ":argh_shared-v0_1_1" ]
deps += [ ":argh_derive-v0_1_4($host_toolchain)" ]
deps += [ ":argh_shared-v0_1_4" ]

rustenv = []

rustflags = [
"--cap-lints=allow",
"--edition=2018",
"-Cmetadata=e6d3638980bc6cc2",
"-Cextra-filename=-e6d3638980bc6cc2",
"-Cmetadata=bd83e7fcbd154aa3",
"-Cextra-filename=-bd83e7fcbd154aa3",
]
}

rust_proc_macro("argh_derive-v0_1_1") {
rust_proc_macro("argh_derive-v0_1_4") {
crate_name = "argh_derive"
crate_root = "//third_party/rust_crates/vendor/argh_derive/src/lib.rs"
output_name = "argh_derive-1a52dd25b67cbf93"
output_name = "argh_derive-d03e76f8d081cdf5"
configs -= [
"//build/config:rust_edition_2018",
"//build/config:rust_2018_idioms",
]

deps = []
deps += [ ":argh_shared-v0_1_1" ]
deps += [ ":argh_shared-v0_1_4" ]
deps += [ ":heck-v0_3_1" ]
deps += [ ":proc-macro2-v1_0_19" ]
deps += [ ":quote-v1_0_7" ]
Expand All @@ -1031,15 +1031,15 @@ rust_proc_macro("argh_derive-v0_1_1") {
rustflags = [
"--cap-lints=allow",
"--edition=2018",
"-Cmetadata=1a52dd25b67cbf93",
"-Cextra-filename=-1a52dd25b67cbf93",
"-Cmetadata=d03e76f8d081cdf5",
"-Cextra-filename=-d03e76f8d081cdf5",
]
}

rust_library("argh_shared-v0_1_1") {
rust_library("argh_shared-v0_1_4") {
crate_name = "argh_shared"
crate_root = "//third_party/rust_crates/vendor/argh_shared/src/lib.rs"
output_name = "argh_shared-caab17a714e9e1db"
output_name = "argh_shared-8b110dad3a849fb"
configs -= [
"//build/config:rust_edition_2018",
"//build/config:rust_2018_idioms",
Expand All @@ -1052,8 +1052,8 @@ rust_library("argh_shared-v0_1_1") {
rustflags = [
"--cap-lints=allow",
"--edition=2018",
"-Cmetadata=caab17a714e9e1db",
"-Cextra-filename=-caab17a714e9e1db",
"-Cmetadata=8b110dad3a849fb",
"-Cextra-filename=-8b110dad3a849fb",
]
}

Expand Down
12 changes: 6 additions & 6 deletions third_party/rust_crates/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion third_party/rust_crates/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ version = "0.1.0"
# Keep this sorted alphabetically, please.
anyhow = "1.0.25"
arbitrary = { version = "0.4.0", features = ["derive"] }
argh = "0.1"
argh = "0.1.4"
arc-swap = "0.4.4"
async-trait = "0.1.40"
base64 = "0.9"
Expand Down
2 changes: 1 addition & 1 deletion third_party/rust_crates/vendor/argh/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":{"CONTRIBUTING.md":"a6280cf23d8b0d8d51bb3e1c8ec64d4cd5ce42eb4b8501475a50fae984d46ec3","Cargo.toml":"ec64bd24c446321a1c455951bc297955169ad82032dbcd5c7df02da981632408","LICENSE":"03b114f53e6587a398931762ee11e2395bfdba252a329940e2c8c9e81813845b","README.md":"a0c022062da5573b64222f755507b823e754f779393dd64af17c64307adee182","code-of-conduct.md":"3cb747e51d90a4ee3b8147b1643ab21c14ff91971e254a8b1a96731175b082e6","src/lib.rs":"b6f66338a6a5b58fd0dc287924c783070ba01de0e511c3a72255918f8ced9547","tests/lib.rs":"bf413af0c523cc8c6e85c515377e50cc08430c9b22ab0b39a85f0f8e85834876"},"package":"ca1877e24cecacd700d469066e0160c4f8497cc5635367163f50c8beec820154"}
{"files":{"CONTRIBUTING.md":"a6280cf23d8b0d8d51bb3e1c8ec64d4cd5ce42eb4b8501475a50fae984d46ec3","Cargo.toml":"73594b71ae84cf5292b7e087a4d77afd87aee1b6b295a6f5663e03b30deca712","LICENSE":"03b114f53e6587a398931762ee11e2395bfdba252a329940e2c8c9e81813845b","README.md":"e25fb39b3e5764573173dc89cf11078e8f495b326698b9a1e4506c00f676a407","code-of-conduct.md":"3cb747e51d90a4ee3b8147b1643ab21c14ff91971e254a8b1a96731175b082e6","rustfmt.toml":"a2d6afdf5fa04b78edf3c24877d46edba97000c9cd8a02202419eddf262138c8","src/lib.rs":"8526a2d43ff223e1d7491e752238e0763acf7c066bcf3955fd28d352583e51f9","tests/lib.rs":"89d66c7f9d6dc9772743a337e4de38979bcf176b95e787a48159e23028997769"},"package":"91792f088f87cdc7a2cfb1d617fa5ea18d7f1dc22ef0e1b5f82f3157cdc522be"}
9 changes: 5 additions & 4 deletions third_party/rust_crates/vendor/argh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
[package]
edition = "2018"
name = "argh"
version = "0.1.3"
authors = ["Taylor Cramer <cramertj@google.com>", "Benjamin Brittain<bwb@google.com>"]
version = "0.1.4"
authors = ["Taylor Cramer <cramertj@google.com>", "Benjamin Brittain <bwb@google.com>", "Erick Tryzelaar <etryzelaar@google.com>"]
description = "Derive-based argument parser optimized for code size"
keywords = ["args", "arguments", "derive", "cli"]
license = "BSD-3-Clause"
repository = "https://github.com/google/argh"
[dependencies.argh_derive]
version = "0.1.1"
version = "0.1.4"

[dependencies.argh_shared]
version = "0.1.1"
version = "0.1.4"
83 changes: 40 additions & 43 deletions third_party/rust_crates/vendor/argh/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Argh
**Argh is an opinionated Derive-based argument parser optimized for code size**

![crates.io](https://img.shields.io/crates/v/argh.svg)
[![crates.io](https://img.shields.io/crates/v/argh.svg)](https://crates.io/crates/argh)
[![license](https://img.shields.io/badge/license-BSD3.0-blue.svg)](https://github.com/google/argh/LICENSE)
[![docs.rs](https://docs.rs/argh/badge.svg)](https://docs.rs/crate/argh/)
![Argh](https://github.com/google/argh/workflows/Argh/badge.svg)

Derive-based argument parsing optimized for code size and conformance
to the Fuchsia commandline tools specification
Expand Down Expand Up @@ -39,7 +42,7 @@ fn main() {

`./some_bin --help` will then output the following:

```bash
```
Usage: cmdname [-j] --height <height> [--pilot-nickname <pilot-nickname>]
Reach new heights.
Expand All @@ -61,15 +64,44 @@ Switches, like `jump`, are optional and will be set to true if provided.
Options, like `height` and `pilot_nickname`, can be either required,
optional, or repeating, depending on whether they are contained in an
`Option` or a `Vec`. Default values can be provided using the
`#[argh(default = "<your_code_here>")]` attribute.
`#[argh(default = "<your_code_here>")]` attribute, and in this case an
option is treated as optional.

```rust
use argh::FromArgs;

fn default_height() -> usize {
5
}

#[derive(FromArgs)]
/// Reach new heights.
struct GoUp {
/// an optional nickname for the pilot
#[argh(option)]
pilot_nickname: Option<String>,

/// an optional height
#[argh(option, default = "default_height()")]
height: usize,

/// an optional direction which is "up" by default
#[argh(option, default = "String::from(\"only up\")")]
direction: String,
}

fn main() {
let up: GoUp = argh::from_env();
}
```

Custom option types can be deserialized so long as they implement the
`FromArgValue` trait (automatically implemented for all `FromStr` types).
If more customized parsing is required, you can supply a custom
`fn(&str) -> Result<T, String>` using the `from_str_fn` attribute:

```
# use argh::FromArgs;
```rust
use argh::FromArgs;

#[derive(FromArgs)]
/// Goofy thing.
Expand All @@ -90,6 +122,7 @@ the structure:

```rust
use argh::FromArgs;

#[derive(FromArgs, PartialEq, Debug)]
/// A command with positional arguments.
struct WithPositional {
Expand All @@ -99,50 +132,14 @@ struct WithPositional {
```

The last positional argument may include a default, or be wrapped in
`Option` or `Vec` to indicate an optional or repeating positional arugment.
`Option` or `Vec` to indicate an optional or repeating positional argument.

Subcommands are also supported. To use a subcommand, declare a separate
`FromArgs` type for each subcommand as well as an enum that cases
over each command:

```rust
# use argh::FromArgs;

#[derive(FromArgs, PartialEq, Debug)]
/// Top-level command.
struct TopLevel {
#[argh(subcommand)]
nested: MySubCommandEnum,
}

#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand)]
enum MySubCommandEnum {
One(SubCommandOne),
Two(SubCommandTwo),
}

#[derive(FromArgs, PartialEq, Debug)]
/// First subcommand.
#[argh(subcommand, name = "one")]
struct SubCommandOne {
#[argh(option)]
/// how many x
x: usize,
}

#[derive(FromArgs, PartialEq, Debug)]
/// Second subcommand.
#[argh(subcommand, name = "two")]
struct SubCommandTwo {
#[argh(switch)]
/// whether to fooey
fooey: bool,
}


```rust
# use argh::FromArgs;
use argh::FromArgs;

#[derive(FromArgs, PartialEq, Debug)]
/// Top-level command.
Expand Down
15 changes: 15 additions & 0 deletions third_party/rust_crates/vendor/argh/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Fuchsia Format Style
# last reviewed: Jan 29, 2019

# Fuchsia uses 2018 edition only
edition = "2018"

# The "Default" setting has a heuristic which splits lines too aggresively.
# We are willing to revisit this setting in future versions of rustfmt.
# Bugs:
# * https://github.com/rust-lang/rustfmt/issues/3119
# * https://github.com/rust-lang/rustfmt/issues/3120
use_small_heuristics = "Max"

# Prevent carriage returns
newline_style = "Unix"
Loading

0 comments on commit bef1eec

Please sign in to comment.