✨ Add long-form option parsing
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
So far we could only add single-letter (POSIX) options: `-e`, `-n` and so forth. Since we will run out of alphabet at some point, this commit introduces parsing of multi-letter long-form (gnu) options (plus any modern application should really support it anyways): `--echo`, `--noline`. Additionally, we support supplying long-form options that supply a value both in the spaced (`--hist-limit 0`) and the equals (`--hist-limit=0`) forms. Short, long, spaced, equals can be mixed and matched between freely. Lastly, we retain the ability to concatenate short options as before (`-ne` is valid, as is `-P0` for the respective options above). This should cover all bases and does not complicate the code too much to keep a coherent overview. Changed several code samples in the documentation to make use of short- or long-form options to point out possibility.
This commit is contained in:
parent
6c037a5771
commit
d44cbf5b74
4 changed files with 123 additions and 45 deletions
|
|
@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
This replaces previous `-P` history flag toggle. Use number to set amount of recent
|
||||
entries to display, `-P3`. To completely hide history use `-P0`.
|
||||
- Add nerdfont emoji set download with `-D nerd`
|
||||
- Add parsing for long-form options (`--private` instead of `-p` and so on):
|
||||
Options requiring a value can be given both in space-separated (`--hist-limit 2`)
|
||||
and equals-separated (`--hist-limit=2`) versions. POSIX option concatenation still
|
||||
works (`-ne` to echo without newline).
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue