- commit
- 726a8e3
- parent
- 64feea6
- author
- Eric Bower
- date
- 2025-10-10 22:02:09 -0400 EDT
feat: version
2 files changed,
+8,
-0
+2,
-0
1@@ -2,6 +2,8 @@ const std = @import("std");
2 const clap = @import("clap");
3 const posix = std.posix;
4
5+pub const version = "0.1.0";
6+
7 const SubCommands = enum {
8 help,
9 daemon,
+6,
-0
1@@ -18,6 +18,12 @@ pub fn main() !void {
2 var res = try cli.parse(allocator, &iter);
3 defer res.deinit();
4
5+ if (res.args.version != 0) {
6+ const version_text = "zmx " ++ cli.version ++ "\n";
7+ _ = try std.posix.write(std.posix.STDOUT_FILENO, version_text);
8+ return;
9+ }
10+
11 const command = res.positionals[0] orelse {
12 try cli.help();
13 return;