feat: support `-t` shorthand

Make `cheat -t <tag>` function as a shorthand for `cheat -l -t <tag>`.
This commit is contained in:
Chris Lane 2020-09-02 17:17:44 -04:00
parent cb0243e7fc
commit c2c479b36c
1 changed files with 3 additions and 0 deletions

View File

@ -185,6 +185,9 @@ func main() {
case opts["<cheatsheet>"] != nil: case opts["<cheatsheet>"] != nil:
cmd = cmdView cmd = cmdView
case opts["--tag"] != nil && opts["--tag"].(string) != "":
cmd = cmdList
default: default:
fmt.Println(usage()) fmt.Println(usage())
os.Exit(0) os.Exit(0)