Commit graph

2830 commits

Author SHA1 Message Date
bors[bot]
ad5606b5a0
Merge #1678
1678: Refactor clap_generate r=CreepySkeleton a=pksunkara

I have copied the code from [clap_generate]( https://github.com/clap-rs/clap_generate) and refactored the structure a bit.

This new structure will allow people to write their own generators using our `Generator` trait which will contain some helpers (Still working on polishing them).

Co-authored-by: Ole Martin Ruud <barskern@outlook.com>
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-02-08 15:00:50 +00:00
bors[bot]
6f4246ef01
Merge #1679
1679: Remove extern & macro_use where possible r=CreepySkeleton a=pksunkara



Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-02-08 14:37:29 +00:00
Ole Martin Ruud
da7e9e5505 Escape colon in zsh completion help 2020-02-07 07:52:04 +01:00
Pavan Kumar Sunkara
e6f77a8713 Added helper methods to generator 2020-02-07 07:52:04 +01:00
Pavan Kumar Sunkara
33f47acc67 Refactor clap_generate 2020-02-07 07:52:04 +01:00
Pavan Kumar Sunkara
5b3a0dff9c Remove extern & macro_use where possible 2020-02-07 07:34:01 +01:00
bors[bot]
7acc9225c6
Merge #1677
1677: Fixed typo in help.rs r=pksunkara a=thomasfermi

Hello everybody, this is my first pull request on github ever. I found a typo in src/output/help.rs. I hope I submitted this pull request the correct way.

Co-authored-by: thomasfermi <mario.theers@gmail.com>
2020-02-05 19:20:21 +00:00
thomasfermi
582e2d39f3 Fixed typo 2020-02-05 17:24:40 +01:00
bors[bot]
f0929d3596
Merge #1676
1676: Get rid of `#[clap(no_version)]` r=pksunkara a=CreepySkeleton

Do what I wanted to do for a long time - get rid of `no_version` and replace it with "no version by default, use `version` to do it explicitly".

Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-02-05 14:44:45 +00:00
CreepySkeleton
8221c4f367 Get rid of #[clap(no_version)] 2020-02-05 16:54:58 +03:00
bors[bot]
509ac33a20
Merge #1664
1664: Import structopt r=pksunkara a=CreepySkeleton

OK, here is about 50% of what's left to import.

`impl StructOpt for Box<impl StructOpt>` is not imported because layouts of `StructOpt` and `Clap` are too different. I'll work it out after the import is done.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/clap-rs/clap/1664)
<!-- Reviewable:end -->


Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
Co-authored-by: David McNeil <mcneil.david2@gmail.com>
2020-02-05 08:43:57 +00:00
bors[bot]
e7d3600128
Merge #1670
1670: Minor refactoring r=pksunkara a=CreepySkeleton

Some minor improvements. Also gets some bugs fixed

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/clap-rs/clap/1670)
<!-- Reviewable:end -->


Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-02-05 08:23:28 +00:00
CreepySkeleton
ffad57c776
Update src/macros.rs
Co-Authored-By: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-02-05 10:44:20 +03:00
CreepySkeleton
28605ba326 Fix macro 2020-02-05 10:17:11 +03:00
CreepySkeleton
0b8f274078 Fix tests 2020-02-05 10:13:39 +03:00
CreepySkeleton
1b2c4344cb Fix visibility errors 2020-02-05 09:41:51 +03:00
David McNeil
62c4266daf Fix verbatim_doc_comment on fields
Signed-off-by: David McNeil <mcneil.david2@gmail.com>
2020-02-05 09:35:21 +03:00
CreepySkeleton
c40eb88d5b Less another one 2020-02-05 09:35:01 +03:00
CreepySkeleton
c7c7e5113c One less hack 2020-02-05 09:34:23 +03:00
Cecile Tonglet
8f3eb4623e Implemented: flatten on enums
Fixes #327
2020-02-05 09:10:59 +03:00
CreepySkeleton
afac737f69 Minor refactoring 2020-02-04 19:02:29 +03:00
CreepySkeleton
596bdec856 Bugfix #324
Fixes https://github.com/TeXitoi/structopt/issues/324
2020-02-04 17:07:39 +03:00
bors[bot]
5d28761630
Merge #1667
1667: Several things r=CreepySkeleton a=pksunkara

* Updated `Cargo.toml` for both crates to be consistent with each other
  * Removed `exclude` key since it is exclusive with `include`
  * Remove things from profiles when they are using default values anyway
* Used `workspace.default-members`
* Cherry pick [this](a525b57cb5) commit from 2.x branch which does not exist in master
* Put the test helper into `tests` folder.

  > The old tests used the include!() macro, which is quite hacky, and hurts compile times

Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Co-authored-by: rleungx <rleungx@gmail.com>
2020-02-04 10:16:40 +00:00
Pavan Kumar Sunkara
b7f76d8e8d Put the test helper in tests 2020-02-04 09:51:46 +01:00
rleungx
4082d1e85c exactly match a subcommand when using the infersubcommands 2020-02-04 09:41:05 +01:00
Pavan Kumar Sunkara
49f096dab2 Use workspace.default-members 2020-02-04 09:41:05 +01:00
CreepySkeleton
cf11d46373 Default value for default_value (yeah, sounds awkward) 2020-02-04 11:40:01 +03:00
Pavan Kumar Sunkara
4d2c8ffa6b Update Cargo.toml files 2020-02-04 09:11:33 +01:00
CreepySkeleton
5aafe9eaaf Pre release tweaks and changelog 2020-02-04 11:10:47 +03:00
bors[bot]
f08d786638
Merge #1628
1628: Macro use removal r=pksunkara a=avandesa

[As of Rust 2018][macro changes], there is no need to call `#[macro_use] extern crate foo` to import the macros from crate `foo`.

This pull request removes mentions of `#[macro_use]` from documentation examples, tests, and benchmarks, in favor of importing the macros directly.

The PR cuts down the number of instances of `#[macro_use]` from 39 down to one, required for importing in-crate macros.

[macro changes]: https://doc.rust-lang.org/nightly/edition-guide/rust-2018/macros/macro-changes.html#macro_rules-style-macros

Co-authored-by: Alex van de Sandt <alex@avandesa.dev>
2020-02-03 18:41:37 +00:00
Alex van de Sandt
050bb7484a Fix formatting 2020-02-03 13:04:07 -05:00
Alex van de Sandt
47031213a2 Remove needless fn main from doc tests 2020-02-03 12:31:24 -05:00
Alex van de Sandt
928ded9d42 Revert "Remove #[macro_use] from src"
This reverts commit 7dcdfc8b231b41a46d4d7ab7ec2664d32804b4a3.

That commit caused doc tests to break, as well as issues with importing
macros in other modules. Note that the yaml example in `src/lib.rs` at
line 184 is broken and should probably be fixed.
2020-02-03 12:04:13 -05:00
Alex van de Sandt
fd6b32ff55 Remove #[macro_use] from src 2020-02-03 12:04:13 -05:00
Alex van de Sandt
90bdd12764 Remove #[macro_use] from benchmarks 2020-02-03 12:01:36 -05:00
Alex van de Sandt
e068826e62 Remove mention of macro_use in doc comment 2020-02-03 12:01:36 -05:00
Alex van de Sandt
1055bbe4aa Remove #[macro_use] from tests 2020-02-03 12:01:36 -05:00
Alex van de Sandt
81b8bdd7fc Remove #[macro_use] from examples 2020-02-03 12:01:36 -05:00
CreepySkeleton
3b11f9af25 Consistent doc comments (#296) 2020-02-03 18:20:08 +03:00
CreepySkeleton
0851fb0266 Introduce #[structopt(rename_all_env)] 2020-02-03 17:56:17 +03:00
bors[bot]
f9818310e8
Merge #1653
1653: Revert " imp: Add exitcode::USAGE exit code as suggested in #1327" r=me a=Dylan-DPC

Reverts clap-rs/clap#1637

Co-authored-by: Dylan DPC <dylan.dpc@gmail.com>
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-02-03 12:50:12 +00:00
Pavan Kumar Sunkara
c5eb08431a Apply suggestions from code review 2020-02-03 12:37:37 +01:00
Dylan DPC
a2ff3fa91b Revert " imp: Add exitcode::USAGE exit code as suggested in #1327" 2020-02-03 12:37:37 +01:00
bors[bot]
5dcc8e60b0
Merge #1658
1658: Faster CI r=CreepySkeleton a=pksunkara

* Moved away from appveyor to decrease the CI time using parallel jobs.
* Improved caching on travis (TODO: azure)

Don't mind the appveyor failing. I will remove those hooks once this PR is merged.

The total CI waiting time decreased from 1 hr to 15-20 mins.

Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-02-03 03:27:47 +00:00
Pavan Kumar Sunkara
6c338e42d0 Faster CI 2020-02-03 03:57:52 +01:00
bors[bot]
526fd73ded
Merge #1657
1657: added check for - r=CreepySkeleton a=Toothless204

Address #1600

Co-authored-by: Toothless204 <38069888+Toothless204@users.noreply.github.com>
2020-02-02 16:51:19 +00:00
Toothless204
ebdc0453eb
Update src/build/arg/mod.rs
make error message more descriptive

Co-Authored-By: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-02-02 12:19:55 +00:00
Toothless204
8b2a9928e8 added check for - 2020-02-02 11:48:35 +00:00
bors[bot]
6422930a18
Merge #1656
1656: Added tests for cargo macros, fixes #1478 r=pksunkara a=pksunkara

When you approve this PR, instead of merging it, please comment "bors r+". I want to test the bors workflow.

Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-02-02 09:44:59 +00:00
Pavan Kumar Sunkara
3fa39a55d2 Update changelog to reflect the correct minimum version 2020-02-02 09:31:09 +01:00