Quellcode durchsuchen

Bring back docs for python!

Luna Stadler vor 4 Jahren
Ursprung
Commit
1395a4942f
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      zig/sdl/hello_sdl.zig

+ 2 - 0
zig/sdl/hello_sdl.zig

@ -157,6 +157,8 @@ fn runCommand(raw_cmd: []const u8, allocator: *std.mem.Allocator) !?[*:0]u8 {
157 157
    const cmd = std.mem.trim(u8, std.mem.sliceTo(raw_cmd, 0), &std.ascii.spaces);
158 158
    const argv = if (std.mem.startsWith(u8, cmd, "go "))
159 159
        &[_][]const u8{ "go", "doc", cmd[3..] }
160
    else if (std.mem.startsWith(u8, cmd, "py "))
161
        &[_][]const u8{ "python", "-c", try std.fmt.allocPrint(allocator, "import {s}; help({s});", .{ cmd["py ".len..], cmd["py ".len..] }) }
160 162
    else
161 163
        &[_][]const u8{ "/usr/bin/qalc", "-terse", cmd };
162 164
    for (argv) |arg| {