4 local pf = io.popen("git help -a")
6 for line in pf:lines() do
7 if line:sub(1, 3) == " " then
8 for i = 4, line:len() do
9 if line:sub(i, i) == " " then
10 table.insert(commands, line:sub(4, i - 1))
19 local f = io.open("idiot", "w")
20 f:write("#! /bin/bash\n")
21 f:write("args=\"${@:2:$#}\"\n")
23 f:write("case $1 in\n")
25 for _, cmd in ipairs(commands) do
26 io.stdout:write(cmd .. ": ")
27 f:write("\"" .. io.stdin:read("*l") .. "\")\n")
28 f:write("git " .. cmd .. " $args\n")