Add --version and --help with clap_lex
This is a better version of my previous attempt. This ensures that cosmic-term can provide its version and some information via the terminal. This is essential for when multiple distributions start using COSMIC.
Clap has the benefit of managing the version automatically by reading Cargo.toml.
Note that my objective is to implement it in most COSMIC apps.
Well it seem fine now.
This feature now has the same structure as in cosmic-greeter, which has been merged and cosmic-player.
What happened to the parsing of --no-daemon?
What happened to the parsing of --no-daemon?
it's still there after my code, between line 111 and 143.
However @mmstick did a great job with cosmic-greeter, puting my code in argparse.rs. So that's an options if you don't want that code there.
I do think the argument parsing must be unified and the help text must mention all possible flags and arguments.
I do think the argument parsing must be unified and the help text must mention all possible flags and arguments.
So I did a thing, hope it's not that bad... I have no objection into having a argparse.rs files from that point.
@jackpot51 My stripped binary size is 36120 KB, 16 BB smaller than the official. So it seem like a clean and efficient way to do it.
If you like it, maybe using vergen and clap_lex should be standardized across all COSMIC apps.