clap-rs / clap

A full featured, fast Command Line Argument Parser for Rust
docs.rs/clap
Apache License 2.0
13.66k stars 1.02k forks source link

fix(clap_complete_nushell): correctly handle commands whose short description is more than one line #5359

Closed poliorcetics closed 4 months ago

poliorcetics commented 4 months ago

Found while trying to add Nushell completions to jj.

Questions

I implemented it in clap_complete_nushell for now, but I could see it being useful in other shells, maybe it should be handled by StyledStr directly ?

poliorcetics commented 4 months ago

f80166c: error Commit subject is too long, 99 exceeds the max length of 50 f80166c: error Line is too long, 99 exceeds the max length of 72

That's annoying to respect, even the Linux kernel doesn't mandate 50 characters anymore

epage commented 4 months ago

I implemented it in clap_complete_nushell for now, but I could see it being useful in other shells, maybe it should be handled by StyledStr directly ?

While I've not always been good about this, I do try to keep the completions in line with each other.

As for StyledStr, that is too low level to care about policy like this.

poliorcetics commented 4 months ago

Thanks for the amazingly quick review! When you have time, could you make a release with the fix ?

epage commented 4 months ago

4.5.1 should already be out with the fix

poliorcetics commented 4 months ago

Ah, I missed it, thanks a lot !