Commit Graph

13 Commits

Author SHA1 Message Date
5080f07724
Add cursor warp option 2024-11-02 08:00:50 -07:00
Isaac Freund
033cad47bf
build: update to Zig 0.12 2024-05-20 11:35:36 +02:00
Isaac Freund
2e586c7061
build: update to Zig 0.11.0 2023-10-16 16:27:03 +02:00
Isaac Freund
b2b2c9ed13
river: add rules system
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-03-12 16:44:19 +01:00
Isaac Freund
2c0c606596
flags: further cleanup after Zig 0.10
Long live the self hosted compiler!
2023-01-08 17:01:14 +01:00
Isaac Freund
09f3f141ae
deps: update to Zig 0.10 2023-01-08 16:21:42 +01:00
Isaac Freund
e18d0d5e1c
flags: automatically prepend '-'
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-28 22:11:14 +01:00
Isaac Freund
16cbe5f469
flags: rewrite to allow [:0]const u8 arguments
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-12-28 20:21:23 +01:00
Isaac Freund
79d7775a3d
code: relicense to GPL-3.0-only
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.
2022-01-31 19:33:22 +01:00
Isaac Freund
c3370afa3d
common/flags: make argFlag() return a slice
We always pass the result of this to mem.span() currently, no need for
the code duplication.
2021-12-15 17:09:45 +01:00
Isaac Freund
23088b800c
common: standardize on -help option
Also:

- Check for -help option *before* unknown options
- Use common flags parsing code for riverctl
- Add usage text to riverctl
2021-07-24 19:31:04 +02:00
Isaac Freund
a5a505ecba
common: remove support for positional arguments
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-24 18:29:48 +02:00
Isaac Freund
f6fa3425de
river: use common CLI arg parsing code
This makes river's main() function quite a bit cleaner.
2021-07-24 16:44:11 +02:00