mirror of
https://github.com/jetzig-framework/jetzig.git
synced 2025-07-01 05:26:07 +00:00
27 lines
644 B
Zig
27 lines
644 B
Zig
const std = @import("std");
|
|
const args = @import("args");
|
|
const version = @import("version");
|
|
|
|
/// Command line options for the `version` command.
|
|
pub const Options = struct {
|
|
pub const meta = .{
|
|
.usage_summary = "",
|
|
.full_text = "Print Jetzig version.",
|
|
};
|
|
};
|
|
|
|
/// Run the `jetzig version` command.
|
|
pub fn run(
|
|
_: std.mem.Allocator,
|
|
_: Options,
|
|
writer: anytype,
|
|
T: type,
|
|
main_options: T,
|
|
) !void {
|
|
if (main_options.options.help) {
|
|
try args.printHelp(Options, "jetzig version", writer);
|
|
return;
|
|
}
|
|
std.debug.print("{s}+{s}\n", .{ version.version, version.commit_hash });
|
|
}
|