aboutsummaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)AuthorFilesLines
2023-10-16build: update to Zig 0.11.0Isaac Freund2-21/+30
2023-03-12river: add rules systemIsaac Freund1-0/+223
This is a breaking change and replaces the previous csd-filter-add/remove and float-filter-add/remove commands. See the riverctl(1) man page for documentation on the new system.
2023-01-08flags: further cleanup after Zig 0.10Isaac Freund1-4/+3
Long live the self hosted compiler!
2023-01-08deps: update to Zig 0.10Isaac Freund1-5/+5
2022-12-28flags: automatically prepend '-'Isaac Freund1-2/+2
This makes the usage a bit cleaner as the results of the parsing may be accessed with e.g. ret.flags.version instead of ret.flags.@"-version".
2022-12-28flags: rewrite to allow [:0]const u8 argumentsIsaac Freund1-85/+80
This also cleans up the code by using @Type(), eliminating the need for the argFlag() and boolFlag() functions. Allowing [:0]const u8 arguments makes this parser useful for river-control commands as well.
2022-01-31code: relicense to GPL-3.0-onlyIsaac Freund1-2/+1
I don't need anyone's permission to make this change since GPL-3.0-or-later is one-way compatible with GPL-3.0-only.
2021-12-15common/flags: make argFlag() return a sliceIsaac Freund1-2/+4
We always pass the result of this to mem.span() currently, no need for the code duplication.
2021-07-24common: standardize on -help optionIsaac Freund1-1/+1
Also: - Check for -help option *before* unknown options - Use common flags parsing code for riverctl - Add usage text to riverctl
2021-07-24common: remove support for positional argumentsIsaac Freund2-126/+104
This is currently unused and I don't like the approach anymore regardless. If/when we need positional arguments (probably when implementing the upcoming river-control protocol in rivertile) they should be handled separately from flags. This commit also improves the CLI error reporting to always print the usage string if invalid arguments were passed.
2021-07-24river: use common CLI arg parsing codeIsaac Freund1-0/+126
This makes river's main() function quite a bit cleaner.