A simple Russian-to-English dictionary written just for fun
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
dict_go/cmd/root.go

23 lines
390 B

package cmd
import (
"os"
)
// ParseArgs parses the first command-line argument and decides which action the
// program takes based on its value (defaulting to word lookup). It panics if
// there is no arguments.
func ParseArgs() {
if len(os.Args) < 2 {
getAllWords()
return
}
switch os.Args[1] {
case "add":
addWord()
case "del":
removeWord()
default:
lookupWord()
}
}