22 Commits

Author SHA1 Message Date
Ben Wiederhake 67373eb4df document new feature and add example / test 2025-04-01 10:37:50 +02:00
Ben Wiederhake dca1347b74 make Options::apply fallible 2025-04-01 10:37:50 +02:00
Terts Diepraam 43f792f91e remove parse and rename try_parse to parse 2023-12-19 15:13:12 +01:00
Terts Diepraam 462898ca91 take positional arguments out of arguments enum 2023-12-19 11:45:43 +01:00
Terts Diepraam 2ba46a2ae9 remove the Initial trait 2023-12-05 16:05:59 +01:00
Terts Diepraam e6a7f379bf unify the option/positional/free attributes into arg 2023-12-03 14:22:42 +01:00
Terts Diepraam 08c0383cb9 move Arg from associated type to type parameter
This allows a struct to implement Options for multiple types. See the tail test for rationale
2023-02-15 14:53:29 +01:00
Terts Diepraam 065eb17b19 remove Options derive in favor of manual implementation 2023-01-19 16:57:11 +01:00
Terts Diepraam 77e0bcda48 add simple error messages (with a lot of room for improvement) 2022-12-31 13:55:58 +01:00
Terts Diepraam 5d4953ebca remove let ... else and fix clippy and rustfmt problems (fixes #7) 2022-12-15 23:49:44 +01:00
Terts Diepraam c911d35821 remove set_true and set_false attributes in favor of the map attribute 2022-12-15 00:08:48 +01:00
Terts Diepraam 870c1d2f29 better handling of option arguments 2022-12-14 23:56:43 +01:00
Terts Diepraam 77fe0e9b9d basic help flag 2022-12-10 15:54:31 +01:00
Terts Diepraam a32f0338e9 add parsing for integers and clone args
I'd rather not clone, but it's the only way I can think of to make the actions in Options ergonomic and not expose weird errors due to the borrow checker. Hopefully, most clones will be removed by the compiler.
2022-12-03 18:50:46 +01:00
Terts Diepraam f735358924 infer long flags and options 2022-12-03 16:17:21 +01:00
Terts Diepraam 74af32a4b9 options with optional values 2022-12-02 13:49:12 +01:00
Terts Diepraam 886b12db5f design 2 2022-12-02 00:41:35 +01:00
Terts Diepraam 07c482538e add options 2022-11-27 23:22:09 +01:00
Terts Diepraam d04b5d50b6 add custom values for flags 2022-11-27 18:41:14 +01:00
Terts Diepraam da74914303 change arguments for flag attribute to strings instead of custom idents 2022-11-27 17:42:36 +01:00
Terts Diepraam 8fcfbf08de add custom names for fields 2022-11-27 16:33:09 +01:00
Terts Diepraam e935ce4698 very first semi-functional version 2022-11-27 14:22:27 +01:00