mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-19 07:31:25 +00:00
extra: enable +help and +version in bash and zsh
This commit is contained in:
@@ -158,9 +158,6 @@ fn writeBashCompletions(writer: *std.Io.Writer) !void {
|
||||
);
|
||||
|
||||
for (@typeInfo(Action).@"enum".fields) |field| {
|
||||
if (std.mem.eql(u8, "help", field.name)) continue;
|
||||
if (std.mem.eql(u8, "version", field.name)) continue;
|
||||
|
||||
const options = @field(Action, field.name).options();
|
||||
// assumes options will never be created with only <_name> members
|
||||
if (@typeInfo(options).@"struct".fields.len == 0) continue;
|
||||
@@ -194,9 +191,6 @@ fn writeBashCompletions(writer: *std.Io.Writer) !void {
|
||||
);
|
||||
|
||||
for (@typeInfo(Action).@"enum".fields) |field| {
|
||||
if (std.mem.eql(u8, "help", field.name)) continue;
|
||||
if (std.mem.eql(u8, "version", field.name)) continue;
|
||||
|
||||
const options = @field(Action, field.name).options();
|
||||
if (@typeInfo(options).@"struct".fields.len == 0) continue;
|
||||
|
||||
@@ -272,9 +266,6 @@ fn writeBashCompletions(writer: *std.Io.Writer) !void {
|
||||
);
|
||||
|
||||
for (@typeInfo(Action).@"enum".fields) |field| {
|
||||
if (std.mem.eql(u8, "help", field.name)) continue;
|
||||
if (std.mem.eql(u8, "version", field.name)) continue;
|
||||
|
||||
try writer.writeAll(pad1 ++ "topLevel+=\" +" ++ field.name ++ "\"\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -139,9 +139,6 @@ fn writeZshCompletions(writer: *std.Io.Writer) !void {
|
||||
var count: usize = 0;
|
||||
const padding = " ";
|
||||
for (@typeInfo(Action).@"enum".fields) |field| {
|
||||
if (std.mem.eql(u8, "help", field.name)) continue;
|
||||
if (std.mem.eql(u8, "version", field.name)) continue;
|
||||
|
||||
try writer.writeAll(padding ++ "'+");
|
||||
try writer.writeAll(field.name);
|
||||
try writer.writeAll("'\n");
|
||||
@@ -168,9 +165,6 @@ fn writeZshCompletions(writer: *std.Io.Writer) !void {
|
||||
{
|
||||
const padding = " ";
|
||||
for (@typeInfo(Action).@"enum".fields) |field| {
|
||||
if (std.mem.eql(u8, "help", field.name)) continue;
|
||||
if (std.mem.eql(u8, "version", field.name)) continue;
|
||||
|
||||
const options = @field(Action, field.name).options();
|
||||
// assumes options will never be created with only <_name> members
|
||||
if (@typeInfo(options).@"struct".fields.len == 0) continue;
|
||||
|
||||
Reference in New Issue
Block a user