aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <mail@isaacfreund.com>2021-11-01 00:34:15 +0100
committerIsaac Freund <mail@isaacfreund.com>2021-11-01 00:34:15 +0100
commitf2cf4b9455f1d80c4ba17e7717a2fc6fa809c35b (patch)
treee5b4a2652eead59be38ca674ffe1e615d1c21ac4
parent4cee1fb881527ebef3331424b3146a0c2ae1a769 (diff)
downloadriver-f2cf4b9455f1d80c4ba17e7717a2fc6fa809c35b.tar.gz
river-f2cf4b9455f1d80c4ba17e7717a2fc6fa809c35b.tar.xz
common: use -h instead of -help
This doesn't really matter that much as unrecognized options will still trigger a help message to be printed, but -h is much more standard so lets make the predictable choice here while sticking to only single '-' flags.
-rw-r--r--doc/river.1.scd2
-rw-r--r--doc/riverctl.1.scd2
-rw-r--r--doc/rivertile.1.scd2
-rw-r--r--river/main.zig6
-rw-r--r--riverctl/main.zig6
-rw-r--r--rivertile/main.zig6
6 files changed, 12 insertions, 12 deletions
diff --git a/doc/river.1.scd b/doc/river.1.scd
index 71735bf..44701e9 100644
--- a/doc/river.1.scd
+++ b/doc/river.1.scd
@@ -20,7 +20,7 @@ utility may be used to communicate with river over these protocols.
# OPTIONS
-*-help*
+*-h*
Print a help message and exit.
*-version*
diff --git a/doc/riverctl.1.scd b/doc/riverctl.1.scd
index 3a59f33..27d68b4 100644
--- a/doc/riverctl.1.scd
+++ b/doc/riverctl.1.scd
@@ -15,7 +15,7 @@ over the Wayland protocol.
# OPTIONS
-*-help*
+*-h*
Print a help message and exit.
*-version*
diff --git a/doc/rivertile.1.scd b/doc/rivertile.1.scd
index f23c6cc..cdb5873 100644
--- a/doc/rivertile.1.scd
+++ b/doc/rivertile.1.scd
@@ -17,7 +17,7 @@ modified while rivertile is running with the help of *riverctl*(1).
# OPTIONS
-*-help*
+*-h*
Print a help message and exit.
*-version*
diff --git a/river/main.zig b/river/main.zig
index f1e75f2..1caa613 100644
--- a/river/main.zig
+++ b/river/main.zig
@@ -31,7 +31,7 @@ const Server = @import("Server.zig");
const usage: []const u8 =
\\usage: river [options]
\\
- \\ -help Print this help message and exit.
+ \\ -h Print this help message and exit.
\\ -version Print the version number and exit.
\\ -c <command> Run `sh -c <command>` on startup.
\\ -log-level <level> Set the log level to error, warning, info, or debug.
@@ -44,7 +44,7 @@ pub fn main() anyerror!void {
// This line is here because of https://github.com/ziglang/zig/issues/7807
const argv: [][*:0]const u8 = os.argv;
const result = flags.parse(argv[1..], &[_]flags.Flag{
- .{ .name = "-help", .kind = .boolean },
+ .{ .name = "-h", .kind = .boolean },
.{ .name = "-version", .kind = .boolean },
.{ .name = "-c", .kind = .arg },
.{ .name = "-log-level", .kind = .arg },
@@ -52,7 +52,7 @@ pub fn main() anyerror!void {
try io.getStdErr().writeAll(usage);
os.exit(1);
};
- if (result.boolFlag("-help")) {
+ if (result.boolFlag("-h")) {
try io.getStdOut().writeAll(usage);
os.exit(0);
}
diff --git a/riverctl/main.zig b/riverctl/main.zig
index 3f54a2e..624f076 100644
--- a/riverctl/main.zig
+++ b/riverctl/main.zig
@@ -30,7 +30,7 @@ const flags = @import("flags");
const usage =
\\usage: riverctl [options] <command>
\\
- \\ -help Print this help message and exit.
+ \\ -h Print this help message and exit.
\\ -version Print the version number and exit.
\\
\\Complete documentation of the recognized commands may be found in
@@ -67,13 +67,13 @@ fn _main() !void {
// This line is here because of https://github.com/ziglang/zig/issues/7807
const argv: [][*:0]const u8 = os.argv;
const result = flags.parse(argv[1..], &[_]flags.Flag{
- .{ .name = "-help", .kind = .boolean },
+ .{ .name = "-h", .kind = .boolean },
.{ .name = "-version", .kind = .boolean },
}) catch {
try io.getStdErr().writeAll(usage);
os.exit(1);
};
- if (result.boolFlag("-help")) {
+ if (result.boolFlag("-h")) {
try io.getStdOut().writeAll(usage);
os.exit(0);
}
diff --git a/rivertile/main.zig b/rivertile/main.zig
index 2116341..19857c3 100644
--- a/rivertile/main.zig
+++ b/rivertile/main.zig
@@ -51,7 +51,7 @@ const flags = @import("flags");
const usage =
\\usage: rivertile [options]
\\
- \\ -help Print this help message and exit.
+ \\ -h Print this help message and exit.
\\ -version Print the version number and exit.
\\ -view-padding Set the padding around views in pixels. (Default 6)
\\ -outer-padding Set the padding around the edge of the layout area in
@@ -314,7 +314,7 @@ pub fn main() !void {
// https://github.com/ziglang/zig/issues/7807
const argv: [][*:0]const u8 = os.argv;
const result = flags.parse(argv[1..], &[_]flags.Flag{
- .{ .name = "-help", .kind = .boolean },
+ .{ .name = "-h", .kind = .boolean },
.{ .name = "-version", .kind = .boolean },
.{ .name = "-view-padding", .kind = .arg },
.{ .name = "-outer-padding", .kind = .arg },
@@ -325,7 +325,7 @@ pub fn main() !void {
try std.io.getStdErr().writeAll(usage);
os.exit(1);
};
- if (result.boolFlag("-help")) {
+ if (result.boolFlag("-h")) {
try std.io.getStdOut().writeAll(usage);
os.exit(0);
}