38 Commits

Author SHA1 Message Date
Vlad Frolov a8b0542c08 chore: release v0.3.2 (#25)
## 🤖 New release

* `interactive-clap-derive`: 0.3.1 -> 0.3.2
* `interactive-clap`: 0.3.1 -> 0.3.2 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `interactive-clap-derive`

<blockquote>

##
[0.3.2](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-derive-v0.3.1...interactive-clap-derive-v0.3.2)
- 2025-02-11

### Added

- propagate doc comments on flags and arguments to `--help/-h` + structs
derive refactor (#26)

### Other

- Added code style check (#29)
</blockquote>

## `interactive-clap`

<blockquote>

##
[0.3.2](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-v0.3.1...interactive-clap-v0.3.2)
- 2025-02-11

### Added

- propagate doc comments on flags and arguments to `--help/-h` + structs
derive refactor (#26)

### Other

- Added "cargo test" command (#33)
- Added clippy to examples (#31)
- Added code style check (#29)
- add CODEOWNERS (#27)
- Added a demo image to README (#24)
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
2025-02-11 13:39:25 +02:00
dj8yf0μl 962ddb9561 feat: propagate doc comments on flags and arguments to --help/-h + structs derive refactor (#26)
the crux of the pr is
https://github.com/near-cli-rs/interactive-clap/pull/26/commits/0c3ce3af6fa98bf597f0ee7e9da3de0663a59fe3
and
https://github.com/near-cli-rs/interactive-clap/pull/26/commits/912744d4365a93590794d1a19abdd3f4755447fe

the rest is some refactoring and splitting big chunks of code into
smaller and nested modules/functions

---

the changes to the logic of derives aren't many and are well summarised
by
the following list of commits with snapshot differences
from the same tests as added to `master` branch in  

https://github.com/dj8yfo/interactive-clap/commits/backporting_tests_into_master/
branch:


*
[test_simple_struct](https://github.com/dj8yfo/interactive-clap/blob/985a46571b95d8ca2f289426dd5f47e93715ce9f/interactive-clap-derive/src/tests/test_simple_struct.rs#L4-L26)
=>
https://github.com/near-cli-rs/interactive-clap/pull/26/commits/eb4b1243f1b6d74a0afd113173b4952d86f19e8a
(fragments reorder)
*
[test_simple_struct_with_named_arg](https://github.com/dj8yfo/interactive-clap/blob/985a46571b95d8ca2f289426dd5f47e93715ce9f/interactive-clap-derive/src/tests/test_simple_struct.rs#L29-L49)
=>
https://github.com/near-cli-rs/interactive-clap/pull/26/commits/ddb38910a99251f9f115a41f328dfaec80ecb146
(fragments reorder)
*
[test_doc_comments_propagate](https://github.com/dj8yfo/interactive-clap/blob/985a46571b95d8ca2f289426dd5f47e93715ce9f/interactive-clap-derive/src/tests/test_simple_struct.rs#L151-L208)
=>
https://github.com/near-cli-rs/interactive-clap/pull/26/commits/6461299b8ee2926c634ba4d9f69e30e372c0c32f
(doc comments propagated, `clap(verbatim_doc_comment)` propagated,
fragments reordered)
*
[test_simple_enum](https://github.com/dj8yfo/interactive-clap/blob/985a46571b95d8ca2f289426dd5f47e93715ce9f/interactive-clap-derive/src/tests/test_simple_enum.rs#L4-L28)
=> no change
*
[test_simple_enum_with_strum_discriminants](https://github.com/dj8yfo/interactive-clap/blob/985a46571b95d8ca2f289426dd5f47e93715ce9f/interactive-clap-derive/src/tests/test_simple_enum.rs#L31-L61)
=> no change
* also a bug was found when integrating new functionality:
* [new
test](https://github.com/dj8yfo/interactive-clap/blob/985a46571b95d8ca2f289426dd5f47e93715ce9f/interactive-clap-derive/src/tests/test_simple_struct.rs#L51-L75)
* [snapshot change in `InteractiveClap`
derive](https://github.com/near-cli-rs/interactive-clap/pull/26/commits/19b20993c19a13d79eab7696d1be6f0f7805fe02),
test passing
* [input change for 2nd stage derive of
`ToCliArgs`](https://github.com/near-cli-rs/interactive-clap/pull/26/commits/29c9aeaf7f219a7b7cc0fbaa8430d4586190d84d)
resulted in [test
failing](https://github.com/near-cli-rs/interactive-clap/actions/runs/13120732036/job/36605779439)


---

second (or 3rd) sub-summary mentions 2 commits
https://github.com/near-cli-rs/interactive-clap/pull/26/commits/382cc33d615128b520d19a2421d63081bfd4a2e5,
https://github.com/near-cli-rs/interactive-clap/pull/26/commits/3db17e1e90c56ab7707c875d6d527ff0387c08e9
which made
a testing step automatic and not requiring to manually copy-paste a
fragment
from snapshot generated with first test assertion.
No snapshots changed as result of these latter 2 commits.

---------

Co-authored-by: dj8yf0μl <noreply@nowhere.org>
Co-authored-by: Artur Yurii Korchynskyi <42449190+akorchyn@users.noreply.github.com>
2025-02-11 12:50:41 +02:00
FroVolod 974ac426bf ci: Added code style check (#29)
Co-authored-by: FroVolod <frol_off@meta.ua>
2025-01-06 22:24:58 +02:00
Vlad Frolov 22fa3eca88 chore: release v0.3.1 (#23)
## 🤖 New release
* `interactive-clap-derive`: 0.3.0 -> 0.3.1
* `interactive-clap`: 0.3.0 -> 0.3.1 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `interactive-clap-derive`
<blockquote>

##
[0.3.1](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-derive-v0.3.0...interactive-clap-derive-v0.3.1)
- 2024-09-18

### Added

- add `long_vec_multiple_opt` attribute
([#22](https://github.com/near-cli-rs/interactive-clap/pull/22))
</blockquote>

## `interactive-clap`
<blockquote>

##
[0.3.1](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-v0.3.0...interactive-clap-v0.3.1)
- 2024-09-18

### Added

- add `long_vec_multiple_opt` attribute
([#22](https://github.com/near-cli-rs/interactive-clap/pull/22))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
2024-09-18 17:29:01 +02:00
dj8yf0μl 94442d867e feat: add long_vec_multiple_opt attribute (#22)
screenshot from `cargo-near` with
[patched](https://github.com/dj8yfo/cargo-near/commit/06fd2569ec47f8a1f90d06814d53ca5897327e8c)
`interactive-clap` version from pr's fork:


![image](https://github.com/user-attachments/assets/a624c011-2a0c-4830-95da-58a0bf553648)

---------

Co-authored-by: dj8yf0μl <noreply@nowhere.org>
2024-09-18 17:27:10 +02:00
Vlad Frolov a7031fcabf chore: release v0.3.0 (#20)
## 🤖 New release
* `interactive-clap-derive`: 0.2.10 -> 0.3.0
* `interactive-clap`: 0.2.10 -> 0.3.0

<details><summary><i><b>Changelog</b></i></summary><p>

## `interactive-clap-derive`
<blockquote>

##
[0.3.0](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-derive-v0.2.10...interactive-clap-derive-v0.3.0)
- 2024-08-09

### Fixed
- [**breaking**] Proxy `try_parse_from` to Clap's `try_parse_from` as
is, instead of naive parsing of `&str`
([#21](https://github.com/near-cli-rs/interactive-clap/pull/21))
</blockquote>

## `interactive-clap`
<blockquote>

##
[0.3.0](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-v0.2.10...interactive-clap-v0.3.0)
- 2024-08-09

### Fixed
- [**breaking**] Proxy `try_parse_from` to Clap's `try_parse_from` as
is, instead of naive parsing of `&str`
([#21](https://github.com/near-cli-rs/interactive-clap/pull/21))

### Other
- Updated examples:struct_with_flatten
([#19](https://github.com/near-cli-rs/interactive-clap/pull/19))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
2024-08-09 13:36:29 +02:00
Sliman4 be41329608 fix!: Proxy try_parse_from to Clap's try_parse_from as is, instead of naive parsing of &str (#21)
`try_parse_from` doesn't have special treatment for quotes (`command
"some thing"` is split into 3 arguments).
2024-08-09 11:18:35 +02:00
Vlad Frolov bd650fe49e chore: release v0.2.10 (#18)
## 🤖 New release
* `interactive-clap-derive`: 0.2.9 -> 0.2.10
* `interactive-clap`: 0.2.9 -> 0.2.10 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `interactive-clap-derive`
<blockquote>

##
[0.2.10](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-derive-v0.2.9...interactive-clap-derive-v0.2.10)
- 2024-04-21

### Added
- Add support for "subargs"
([#17](https://github.com/near-cli-rs/interactive-clap/pull/17))
</blockquote>

## `interactive-clap`
<blockquote>

##
[0.2.10](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-v0.2.9...interactive-clap-v0.2.10)
- 2024-04-21

### Added
- Add support for "subargs"
([#17](https://github.com/near-cli-rs/interactive-clap/pull/17))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
2024-04-21 15:24:09 +02:00
FroVolod 62f08fd6ad feat: Add support for "subargs" (#17) 2024-04-21 13:35:25 +02:00
Vlad Frolov da7ce56b59 chore: release (#16)
## 🤖 New release
* `interactive-clap-derive`: 0.2.8 -> 0.2.9
* `interactive-clap`: 0.2.8 -> 0.2.9 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `interactive-clap-derive`
<blockquote>

##
[0.2.9](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-derive-v0.2.8...interactive-clap-derive-v0.2.9)
- 2024-03-25

### Added
- Added support for "#[interactive_clap(flatten)]"
([#15](https://github.com/near-cli-rs/interactive-clap/pull/15))
</blockquote>

## `interactive-clap`
<blockquote>

##
[0.2.9](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-v0.2.8...interactive-clap-v0.2.9)
- 2024-03-25

### Added
- Added support for "#[interactive_clap(flatten)]"
([#15](https://github.com/near-cli-rs/interactive-clap/pull/15))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
2024-03-25 12:16:27 +01:00
FroVolod d07d192fc6 feat: Added support for "#[interactive_clap(flatten)]" (#15)
Co-authored-by: FroVolod <frol_off@meta.ua>
2024-03-25 12:10:47 +01:00
Vlad Frolov 2f55008fc2 chore: release (#14)
## 🤖 New release
* `interactive-clap-derive`: 0.2.7 -> 0.2.8
* `interactive-clap`: 0.2.7 -> 0.2.8 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `interactive-clap-derive`
<blockquote>

##
[0.2.8](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-derive-v0.2.7...interactive-clap-derive-v0.2.8)
- 2024-01-15

### Added
- Added possibility to process optional fields
([#13](https://github.com/near-cli-rs/interactive-clap/pull/13))
</blockquote>

## `interactive-clap`
<blockquote>

##
[0.2.8](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-v0.2.7...interactive-clap-v0.2.8)
- 2024-01-15

### Added
- Added possibility to process optional fields
([#13](https://github.com/near-cli-rs/interactive-clap/pull/13))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Signed-off-by: Vlad Frolov <304265+frol@users.noreply.github.com>
Co-authored-by: Vlad Frolov <304265+frol@users.noreply.github.com>
2024-01-15 11:18:58 +01:00
FroVolod 4ce98504ef feat: Added possibility to process optional fields (#13)
Automatic generation of "interactive_clap::FromCli" for structures with
optional fields

---------

Co-authored-by: Vlad Frolov <frolvlad@gmail.com>
2024-01-15 12:14:27 +02:00
Vlad Frolov db8c2016bf chore: release (#12)
## 🤖 New release
* `interactive-clap-derive`: 0.2.6 -> 0.2.7
* `interactive-clap`: 0.2.6 -> 0.2.7

<details><summary><i><b>Changelog</b></i></summary><p>

## `interactive-clap-derive`
<blockquote>

##
[0.2.7](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-derive-v0.2.6...interactive-clap-derive-v0.2.7)
- 2023-10-13

### Added
- Add support for "flatten"
([#11](https://github.com/near-cli-rs/interactive-clap/pull/11))
</blockquote>

## `interactive-clap`
<blockquote>

##
[0.2.7](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-v0.2.6...interactive-clap-v0.2.7)
- 2023-10-13

### Other
- updated the following local packages: interactive-clap-derive
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Signed-off-by: release-plz <release-plz@github.com>
Co-authored-by: release-plz <release-plz@github.com>
2023-10-13 09:30:23 +02:00
FroVolod 437521ff5c feat: Add support for "flatten" (#11) 2023-10-13 10:14:51 +03:00
Vlad Frolov 67e54b4086 chore: release (#10)
## 🤖 New release
* `interactive-clap-derive`: 0.2.5 -> 0.2.6
* `interactive-clap`: 0.2.5 -> 0.2.6 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `interactive-clap-derive`
<blockquote>

##
[0.2.6](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-derive-v0.2.5...interactive-clap-derive-v0.2.6)
- 2023-10-05

### Fixed
- named_args/unnamed_args/args_without_attrs conflict
([#9](https://github.com/near-cli-rs/interactive-clap/pull/9))
</blockquote>

## `interactive-clap`
<blockquote>

##
[0.2.6](https://github.com/near-cli-rs/interactive-clap/compare/interactive-clap-v0.2.5...interactive-clap-v0.2.6)
- 2023-10-05

### Fixed
- named_args/unnamed_args/args_without_attrs conflict
([#9](https://github.com/near-cli-rs/interactive-clap/pull/9))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Signed-off-by: release-plz <release-plz@github.com>
Co-authored-by: release-plz <release-plz@github.com>
2023-10-05 10:49:11 +03:00
FroVolod 77cb26c33f fix: named_args/unnamed_args/args_without_attrs conflict (#9)
* fixed

* updated examples/advanced_struct

* refactored InteractiveClapAttrsCliField::new()

* Update interactive-clap-derive/src/derives/to_cli_args/methods/interactive_clap_attrs_cli_field.rs

Co-authored-by: Vlad Frolov <frolvlad@gmail.com>

* refactored InteractiveClapAttrsCliField

---------

Co-authored-by: Vlad Frolov <frolvlad@gmail.com>
2023-10-05 10:46:46 +03:00
Vlad Frolov a627fc0c9f chore: release (#8)
Signed-off-by: release-plz <release-plz@github.com>
Co-authored-by: release-plz <release-plz@github.com>
2023-09-30 08:29:22 +02:00
FroVolod 2df6182314 added fn try_parse_from() 2023-09-21 15:08:18 +03:00
FroVolod 2cc575c8de Merge branch 'master' of https://github.com/FroVolod/interactive-clap 2023-09-15 13:35:17 +03:00
FroVolod 0f4e7d51a7 fixed unnamed_args/args_without_attrs conflict 2023-09-15 13:34:47 +03:00
Vlad Frolov 0af8a4aca7 refactor: addressed compiler warnings 2023-06-02 22:10:37 +02:00
Vlad Frolov a844585c61 chore: release (#7)
Co-authored-by: release-plz <release-plz@github.com>
2023-06-02 19:51:48 +02:00
Vlad Frolov dea28e482a feat: Add support for boolean flags (e.g. --offline) (#6) 2023-06-02 19:49:58 +02:00
Vlad Frolov 879efbd0d1 chore: release (#5)
Co-authored-by: release-plz <release-plz@github.com>
2023-05-30 17:15:05 +02:00
Vlad Frolov d80edfc842 fix: Trim unnecessary spaces in inquire prompts (fix it again after recent refactoring that reverted the previous fix) 2023-05-30 16:49:50 +02:00
Vlad Frolov 4c7254083a chore: release 0.2.2 2023-05-28 22:44:57 +02:00
Vlad Frolov a4234e796a fix: Handle quotes in doc-string for interactive prompt messages properly 2023-05-28 22:14:30 +02:00
Vlad Frolov 3b409c8d3c release: v0.2.1 2023-05-21 11:41:18 +02:00
FroVolod d0fd82f2e6 fixed extra space at the beginning of the line 2023-05-20 21:28:58 +03:00
FroVolod ec88899e54 refactor: Use a custom ResultFromCli to enable Cancel and Back variants and lift CLI args on Ok/Err (#4) 2023-04-02 21:24:06 +02:00
FroVolod cf53b907a3 Revert "draft: Result to ResultFromCli" 2023-03-01 22:46:13 +02:00
FroVolod 54b154b0f8 draft: Result to ResultFromCli 2023-03-01 22:32:39 +02:00
FroVolod 95d20ca7b5 fixed output_context 2023-02-24 09:55:16 +02:00
FroVolod bdda4aecfb fixed 2023-02-21 16:13:34 +02:00
FroVolod 9cc2279697 fixed from_cli_arg 2023-02-19 21:22:23 +02:00
FroVolod 0151a59442 refactoring from_cli_for_struct 2023-02-18 22:58:16 +02:00
Vlad Frolov f8121df39c prepare for publishing to Crates.io 2022-12-20 16:05:06 +01:00