mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-22 19:56:08 +03:00
@ -4,31 +4,10 @@ const builtin = @import("builtin");
|
|||||||
const build_config = @import("../build_config.zig");
|
const build_config = @import("../build_config.zig");
|
||||||
const xev = @import("xev");
|
const xev = @import("xev");
|
||||||
const renderer = @import("../renderer.zig");
|
const renderer = @import("../renderer.zig");
|
||||||
const args = @import("args.zig");
|
|
||||||
const Action = @import("action.zig").Action;
|
|
||||||
|
|
||||||
pub const Options = struct {
|
|
||||||
pub fn deinit(self: Options) void {
|
|
||||||
_ = self;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Enables `-h` and `--help` to work.
|
|
||||||
pub fn help(self: Options) !void {
|
|
||||||
_ = self;
|
|
||||||
return Action.help_error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/// The `version` command is used to display information about Ghostty.
|
/// The `version` command is used to display information about Ghostty.
|
||||||
pub fn run(alloc: Allocator) !u8 {
|
pub fn run(alloc: Allocator) !u8 {
|
||||||
var opts: Options = .{};
|
_ = alloc;
|
||||||
defer opts.deinit();
|
|
||||||
|
|
||||||
{
|
|
||||||
var iter = try std.process.argsWithAllocator(alloc);
|
|
||||||
defer iter.deinit();
|
|
||||||
try args.parse(Options, alloc, &opts, &iter);
|
|
||||||
}
|
|
||||||
|
|
||||||
const stdout = std.io.getStdOut().writer();
|
const stdout = std.io.getStdOut().writer();
|
||||||
try stdout.print("Ghostty {s}\n\n", .{build_config.version_string});
|
try stdout.print("Ghostty {s}\n\n", .{build_config.version_string});
|
||||||
|
Reference in New Issue
Block a user