Tags: matklad/xflags
Tags
Merge pull request #40 from O-X-E-Y/master Add a `help` command and generate help messages per command
Merge #25 25: handle `-h,--help` automatically r=matklad a=matklad Originally, I was reluctant to put `std::process::exit` in the library, but two observations finally swayed me: * Adding `_or_exit` to the name goes along way in dispelling concerns about magical behavior * Looking at the "why" of xflags, we should prioritize convenience over control. Co-authored-by: Aleksey Kladov <[email protected]>
Merge #15 15: Support multiline doc comments r=matklad a=thomcc Previously these didn't work, and it was kind of annoying trying to describe things in one line. The fix is pretty simple, most of the diff is from extending tests/it/help and regenerating it. I thought about trying to either mirror the logic [structopt](https://github.com/TeXitoi/structopt/blob/d16cfd264d3173fe64a883dea67e9975dc7bbb2d/structopt-derive/src/doc_comments.rs#L1) or [rustdoc](https://github.com/rust-lang/rust/blob/6c2dd251bbff03c7a3092d43fb5b637eca0810e3/compiler/rustc_ast/src/util/comments.rs#L28) use... but it gets pretty convoluted. I figure for terminal output this doesn't matter that much. Also it's easier just to preserve the way the user formatted it for now, and that gets 90% of there anyway, so long as people don't use multiline comments (which you can just not use here, if you're in the minority of rust users who prefer them). This also ensures stuff like markdown lists stay formatted, which is a problem with structopt's approach. I had to re-enable the `help` "test" (I dont think it's used to test anything, aside from somethign perhaps that the output matches? I wasn't sure how to test beyond that, but I did make sure to update it, so you can see the results here. I also fixed a minor issue with how your xtask prints its help message. (This is entirely unrelated, admittedly) Co-authored-by: Thom Chiovoloni <[email protected]>
PreviousNext