29 Commits

Author SHA1 Message Date
Terts Diepraam 3f82b06d49 fix link in doc 2023-11-09 13:08:47 +01:00
Terts Diepraam 0d7c1b747f remove markdown rendering and make help write to stdout
The markdown rendering is too complicated at the moment
and slows the rest of development down too much. We can
add it back in later.

The generated code for the help string now writes
directly to stdout, instead of building up a String,
this leads to nicer code and is probably faster.
2023-06-04 14:09:07 +02:00
Terts Diepraam 946728596b Fix tests for new initial macro 2023-03-08 16:06:40 +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 2565a99011 refactor value parsing 2023-02-14 00:51:27 +01:00
Terts Diepraam d9ca915139 document more of the public API 2023-02-13 18:09:34 +01:00
Terts Diepraam b1e7c9cba4 start writing some module documentation 2023-02-08 23:31:49 +01:00
Terts Diepraam af70102ec5 support echo style parsing (where invalid arguments become positional arguments) 2023-02-08 22:45:53 +01:00
Terts Diepraam 2dbf88ffaa Add option for -{N} and +{N} args (closes #2) 2023-02-06 13:38:47 +01:00
Terts Diepraam 065eb17b19 remove Options derive in favor of manual implementation 2023-01-19 16:57:11 +01:00
Terts Diepraam dd5c3efc34 add exit code and arguments attribute (closes #13) 2023-01-10 21:32:17 +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 8167c9670f add field attribute with default and env var 2022-12-29 18:24:32 +01:00
Terts Diepraam 4cca82fbbe infer values from unabiguous prefixes (closes #9) 2022-12-29 16:05:23 +01:00
Terts Diepraam 870c1d2f29 better handling of option arguments 2022-12-14 23:56:43 +01:00
Terts Diepraam 58bbbfe6f4 add version flags and refactor all flag handling with a Flags struct 2022-12-10 20:43:15 +01:00
Terts Diepraam 2e3171a604 fix clippy lints 2022-12-10 18:08:48 +01:00
Terts Diepraam f1f4ee9eec add a simple usage string to the help output 2022-12-10 17:47:56 +01:00
Terts Diepraam 77fe0e9b9d basic help flag 2022-12-10 15:54:31 +01:00
Terts Diepraam 6b7c612431 positional arguments! 2022-12-09 01:39:11 +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 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 447f64b8d4 define parse as wrapper around apply_args
This takes some code out of the macro and allows us to use `self`
2022-11-27 17:58:47 +01:00