git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commitce64be57f0363f97590549e96d31cdb39174cf93
parenta7e206e6e3
authorIsaac Freund <[email protected]>
date2021-11-01 00:34
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.

 doc/river.1.scd     | 2 +-
 doc/riverctl.1.scd  | 2 +-
 doc/rivertile.1.scd | 2 +-
 river/main.zig      | 6 +++---
 riverctl/main.zig   | 6 +++---
 rivertile/main.zig  | 6 +++---
 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);
     }