From 4f8431a600ac79a864e99c19ab4ea01ee355b798 Mon Sep 17 00:00:00 2001 From: exploide Date: Tue, 5 Nov 2019 15:53:21 +0100 Subject: [PATCH 1/2] fixed some cli option typos --- README.md | 4 ++-- cmd/cheat/str_config.go | 4 ++-- configs/conf.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6868bc3..5fb0414 100644 --- a/README.md +++ b/README.md @@ -178,11 +178,11 @@ To search (by regex) for cheatsheets that contain an IP address: cheat -r -s '(?:[0-9]{1,3}\.){3}[0-9]{1,3}' ``` -Flags may be combined in inuitive ways. Example: to search sheets on the +Flags may be combined in intuitive ways. Example: to search sheets on the "personal" cheatpath that are tagged with "networking" and match a regex: ```sh -cheat -p personal -t networking -s --regex '(?:[0-9]{1,3}\.){3}[0-9]{1,3}' +cheat -p personal -t networking --regex -s '(?:[0-9]{1,3}\.){3}[0-9]{1,3}' ``` diff --git a/cmd/cheat/str_config.go b/cmd/cheat/str_config.go index f2a779a..fbf98e7 100644 --- a/cmd/cheat/str_config.go +++ b/cmd/cheat/str_config.go @@ -32,9 +32,9 @@ formatter: terminal16m # "upstream" cheatsheets. # # But what if you want to view the "upstream" cheatsheets instead of your own? -# Cheatsheets may be filtered via 'cheat -f ' in combination with other +# Cheatsheets may be filtered via 'cheat -t ' in combination with other # commands. So, if you want to view the 'tar' cheatsheet that is tagged as -# 'community' rather than your own, you can use: cheat tar -f community +# 'community' rather than your own, you can use: cheat tar -t community cheatpaths: # Paths that come earlier are considered to be the most "global", and will diff --git a/configs/conf.yml b/configs/conf.yml index 83e4615..e66507c 100644 --- a/configs/conf.yml +++ b/configs/conf.yml @@ -23,9 +23,9 @@ formatter: terminal16m # "upstream" cheatsheets. # # But what if you want to view the "upstream" cheatsheets instead of your own? -# Cheatsheets may be filtered via 'cheat -f ' in combination with other +# Cheatsheets may be filtered via 'cheat -t ' in combination with other # commands. So, if you want to view the 'tar' cheatsheet that is tagged as -# 'community' rather than your own, you can use: cheat tar -f community +# 'community' rather than your own, you can use: cheat tar -t community cheatpaths: # Paths that come earlier are considered to be the most "global", and will From 67469b0afa75685779190d2828661a215f1c70fb Mon Sep 17 00:00:00 2001 From: exploide Date: Tue, 5 Nov 2019 17:29:32 +0100 Subject: [PATCH 2/2] added cheat 3.x autocompletion file for fish shell, see #476 --- scripts/cheat-autocompletion.fish | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 scripts/cheat-autocompletion.fish diff --git a/scripts/cheat-autocompletion.fish b/scripts/cheat-autocompletion.fish new file mode 100644 index 0000000..10d7293 --- /dev/null +++ b/scripts/cheat-autocompletion.fish @@ -0,0 +1,11 @@ +complete -c cheat -f -a "(cheat -l | tail -n +2 | cut -d ' ' -f 1)" +complete -c cheat -l init -d "Write a default config file to stdout" +complete -c cheat -s c -l colorize -d "Colorize output" +complete -c cheat -s d -l directories -d "List cheatsheet directories" +complete -c cheat -s e -l edit -x -a "(cheat -l | tail -n +2 | cut -d ' ' -f 1)" -d "Edit cheatsheet" +complete -c cheat -s l -l list -d "List cheatsheets" +complete -c cheat -s p -l path -x -a "(cheat -d | cut -d ':' -f 1)" -d "Return only sheets found on given path" +complete -c cheat -s r -l regex -d "Treat search phrase as a regex" +complete -c cheat -s s -l search -x -d "Search cheatsheets for given phrase" +complete -c cheat -s t -l tag -x -a "(cheat -l | tail -n +2 | rev | cut -d ' ' -f 1 | rev | sed 's/,/\n/g;/^\$/d' | sort -u)" -d "Return only sheets matching the given tag" +complete -c cheat -s v -l version -d "Print the version number"