|
|
@ -238,7 +238,7 @@ const GoDocRunner = struct {
|
|
238
|
238
|
|
|
239
|
239
|
const PythonHelpRunner = struct {
|
|
240
|
240
|
fn init() Runner {
|
|
241
|
|
return Runner{ .name = "python help", .run_always = true, .toArgv = toArgv, .isActive = isActive };
|
|
|
241
|
return Runner{ .name = "python docs", .run_always = true, .toArgv = toArgv, .isActive = isActive };
|
|
242
|
242
|
}
|
|
243
|
243
|
|
|
244
|
244
|
fn isActive(cmd: []const u8) bool {
|
|
|
@ -266,6 +266,36 @@ const PythonRunner = struct {
|
|
266
|
266
|
}
|
|
267
|
267
|
};
|
|
268
|
268
|
|
|
|
269
|
const RubyHelpRunner = struct {
|
|
|
270
|
fn init() Runner {
|
|
|
271
|
return Runner{ .name = "ruby docs", .run_always = true, .toArgv = toArgv, .isActive = isActive };
|
|
|
272
|
}
|
|
|
273
|
|
|
|
274
|
fn isActive(cmd: []const u8) bool {
|
|
|
275
|
return cmd.len > 3 and std.mem.startsWith(u8, cmd, "rb ");
|
|
|
276
|
}
|
|
|
277
|
|
|
|
278
|
fn toArgv(cmd: []const u8) []const []const u8 {
|
|
|
279
|
_ = std.fmt.bufPrint(&cmd_buf, "{s}\x00", .{cmd["rb ".len..]}) catch "???";
|
|
|
280
|
return &[_][]const u8{ "ri", &cmd_buf };
|
|
|
281
|
}
|
|
|
282
|
};
|
|
|
283
|
|
|
|
284
|
const RubyRunner = struct {
|
|
|
285
|
fn init() Runner {
|
|
|
286
|
return Runner{ .name = "ruby run", .run_always = true, .toArgv = toArgv, .isActive = isActive };
|
|
|
287
|
}
|
|
|
288
|
|
|
|
289
|
fn isActive(cmd: []const u8) bool {
|
|
|
290
|
return cmd.len > 3 and std.mem.startsWith(u8, cmd, "rb! ");
|
|
|
291
|
}
|
|
|
292
|
|
|
|
293
|
fn toArgv(cmd: []const u8) []const []const u8 {
|
|
|
294
|
_ = std.fmt.bufPrint(&cmd_buf, "puts({s})\x00", .{cmd["rb! ".len..]}) catch "???";
|
|
|
295
|
return &[_][]const u8{ "ruby", "-e", &cmd_buf };
|
|
|
296
|
}
|
|
|
297
|
};
|
|
|
298
|
|
|
269
|
299
|
const HelpRunner = struct {
|
|
270
|
300
|
fn init() Runner {
|
|
271
|
301
|
return Runner{ .name = "--help", .run_always = true, .toArgv = toArgv, .isActive = isActive };
|
|
|
@ -416,6 +446,8 @@ pub fn main() !void {
|
|
416
|
446
|
GoDocRunner.init(),
|
|
417
|
447
|
PythonHelpRunner.init(),
|
|
418
|
448
|
PythonRunner.init(),
|
|
|
449
|
RubyHelpRunner.init(),
|
|
|
450
|
RubyRunner.init(),
|
|
419
|
451
|
HelpRunner.init(),
|
|
420
|
452
|
ManPageRunner.init(),
|
|
421
|
453
|
SearchRunner.init(),
|