feat: add metadata to all commands
This commit is contained in:
parent
bdd16f43fb
commit
d75dcd7b84
13 changed files with 221 additions and 6 deletions
|
@ -572,25 +572,30 @@ const cmds_ = struct {
|
|||
const Ctx = command.Context;
|
||||
const Result = command.Result;
|
||||
|
||||
pub fn @"w"(self: *Self, _: Ctx) Result {
|
||||
pub fn w(self: *Self, _: Ctx) Result {
|
||||
try self.cmd("save_file", .{});
|
||||
}
|
||||
pub const w_meta = .{ .description = "w (write file)" };
|
||||
|
||||
pub fn @"q"(self: *Self, _: Ctx) Result {
|
||||
pub fn q(self: *Self, _: Ctx) Result {
|
||||
try self.cmd("quit", .{});
|
||||
}
|
||||
pub const q_meta = .{ .description = "w (quit)" };
|
||||
|
||||
pub fn @"q!"(self: *Self, _: Ctx) Result {
|
||||
try self.cmd("quit_without_saving", .{});
|
||||
}
|
||||
pub const @"q!_meta" = .{ .description = "q! (quit without saving)" };
|
||||
|
||||
pub fn @"wq"(self: *Self, _: Ctx) Result {
|
||||
pub fn wq(self: *Self, _: Ctx) Result {
|
||||
try self.cmd("save_file", .{});
|
||||
try self.cmd("quit", .{});
|
||||
}
|
||||
pub const wq_meta = .{ .description = "wq (write file and quit)" };
|
||||
|
||||
pub fn @"wq!"(self: *Self, _: Ctx) Result {
|
||||
self.cmd("save_file", .{}) catch {};
|
||||
try self.cmd("quit_without_saving", .{});
|
||||
}
|
||||
pub const @"wq!_meta" = .{ .description = "wq! (write file and quit without saving)" };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue