diff --git a/bitcoin.go b/bitcoin.go deleted file mode 100644 index cc02eda..0000000 --- a/bitcoin.go +++ /dev/null @@ -1,116 +0,0 @@ -package main - -import ( - "html" - "io/ioutil" - "os/exec" - "strings" -) - -type Command struct { - name string - description string -} - -type Group struct { - name string - commands []Command -} - -func main() { - first := run("help") - split := strings.Split(first, "\n") - - groups := make([]Group, 0) - commands := make([]Command, 0) - lastGroupName := "" - - for _, line := range split { - if len(line) > 0 { - if strings.HasPrefix(line, "== ") { - if len(commands) != 0 { - g := Group{ - name: lastGroupName, - commands: commands, - } - groups = append(groups, g) - commands = make([]Command, 0) - } - lastGroupName = line[3 : len(line)-3] - } else { - name := strings.Split(line, " ")[0] - desc := run("help", name) - desc = html.EscapeString(desc) - comm := Command{ - name: name, - description: desc, - } - commands = append(commands, comm) - } - } - } - - g := Group{ - name: lastGroupName, - commands: commands, - } - groups = append(groups, g) - - menuStr := "" - for _, group := range groups { - menuStr += ` -