-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: shell completions working correctly
- Loading branch information
Showing
6 changed files
with
55 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,11 @@ | ||
Dec 15 11:09 [33m --- [36m jonathan [0m[34m .[0m | ||
Dec 12 00:13 [33m --- [36m jonathan [0m[34m ..[0m | ||
Nov 07 09:07 [33m --- [36m jonathan [0m[34m .cache[0m | ||
Dec 15 11:22 [33m --- [36m jonathan [0m[34m .git[0m | ||
Nov 07 09:01 [33m --- [36m jonathan [0m[34m .github[0m | ||
Nov 30 21:57 [33m --- [36m jonathan [0m[34m assets[0m | ||
Dec 15 10:52 [33m --- [36m jonathan [0m[34m build[0m | ||
Nov 24 21:27 [33m --- [36m jonathan [0m[34m completions[0m | ||
Dec 13 17:35 [33m --- [36m jonathan [0m[34m include[0m | ||
Dec 11 22:34 [33m --- [36m jonathan [0m[34m lua[0m | ||
Dec 15 11:22 [33m --- [36m jonathan [0m[34m scripts[0m | ||
Dec 15 10:52 [33m --- [36m jonathan [0m[34m src[0m | ||
Oct 13 18:24 [33m 863 B [36m jonathan [0m[90m .clang-format[0m | ||
Nov 30 21:57 [33m 72 B [36m jonathan [0m[90m .gitignore[0m | ||
Dec 15 10:45 [33m 110 B [36m jonathan [0m[90m .quickmarks[0m | ||
Dec 13 16:40 [33m 2.47 KB [36m jonathan [0m[38m CMakeLists.txt[0m | ||
Dec 12 23:07 [33m 7.81 KB [36m jonathan [0m[38m CONFIGURATION.md[0m | ||
Nov 30 21:57 [33m 5.40 KB [36m jonathan [0m[38m CONTRIBUTING.md[0m | ||
Dec 13 16:40 [33m 938 B [36m jonathan [0m[38m FindLibgit2.cmake[0m | ||
Nov 24 21:27 [33m 1.05 KB [36m jonathan [0m[38m LICENSE[0m | ||
Dec 15 11:09 [33m 4.18 KB [36m jonathan [0m[38m README.md[0m | ||
Nov 30 21:57 [33m 910 B [36m jonathan [0m[38m cmake_uninstall.cmake.in[0m | ||
Dec 08 16:53 [33m 5.68 KB [36m jonathan [0m[38m compile_commands.json[0m | ||
Dec 15 10:53 [33m 230 B [36m jonathan [0m[38m todo[0m | ||
_lsr() { | ||
local cur prev opts | ||
COMPREPLY=() | ||
cur="${COMP_WORDS[COMP_CWORD]}" | ||
opts="-a --all -F --Files -D --Directories -S --Symlinks -G --Git -g --git-status -i --git-ignored -l --long -r --recursive -f --filter -v --version -h --help --completions " | ||
if [[ ${cur} == -* ]]; then | ||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) | ||
fi | ||
return 0 | ||
} | ||
complete -F _lsr lsr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,14 @@ | ||
Dec 15 11:09 [33m --- [36m jonathan [0m[34m .[0m | ||
Dec 12 00:13 [33m --- [36m jonathan [0m[34m ..[0m | ||
Nov 07 09:07 [33m --- [36m jonathan [0m[34m .cache[0m | ||
Dec 15 11:22 [33m --- [36m jonathan [0m[34m .git[0m | ||
Nov 07 09:01 [33m --- [36m jonathan [0m[34m .github[0m | ||
Nov 30 21:57 [33m --- [36m jonathan [0m[34m assets[0m | ||
Dec 15 10:52 [33m --- [36m jonathan [0m[34m build[0m | ||
Nov 24 21:27 [33m --- [36m jonathan [0m[34m completions[0m | ||
Dec 13 17:35 [33m --- [36m jonathan [0m[34m include[0m | ||
Dec 11 22:34 [33m --- [36m jonathan [0m[34m lua[0m | ||
Dec 15 11:22 [33m --- [36m jonathan [0m[34m scripts[0m | ||
Dec 15 10:52 [33m --- [36m jonathan [0m[34m src[0m | ||
Oct 13 18:24 [33m 863 B [36m jonathan [0m[90m .clang-format[0m | ||
Nov 30 21:57 [33m 72 B [36m jonathan [0m[90m .gitignore[0m | ||
Dec 15 10:45 [33m 110 B [36m jonathan [0m[90m .quickmarks[0m | ||
Dec 13 16:40 [33m 2.47 KB [36m jonathan [0m[38m CMakeLists.txt[0m | ||
Dec 12 23:07 [33m 7.81 KB [36m jonathan [0m[38m CONFIGURATION.md[0m | ||
Nov 30 21:57 [33m 5.40 KB [36m jonathan [0m[38m CONTRIBUTING.md[0m | ||
Dec 13 16:40 [33m 938 B [36m jonathan [0m[38m FindLibgit2.cmake[0m | ||
Nov 24 21:27 [33m 1.05 KB [36m jonathan [0m[38m LICENSE[0m | ||
Dec 15 11:09 [33m 4.18 KB [36m jonathan [0m[38m README.md[0m | ||
Nov 30 21:57 [33m 910 B [36m jonathan [0m[38m cmake_uninstall.cmake.in[0m | ||
Dec 08 16:53 [33m 5.68 KB [36m jonathan [0m[38m compile_commands.json[0m | ||
Dec 15 10:53 [33m 230 B [36m jonathan [0m[38m todo[0m | ||
# Fish completions for lsr | ||
complete -c lsr -s a -l all -d 'Show all entries, including hidden' | ||
complete -c lsr -s F -l Files -d 'Show files only' | ||
complete -c lsr -s D -l Directories -d 'Show directories only' | ||
complete -c lsr -s S -l Symlinks -d 'Show symlinks only' | ||
complete -c lsr -s G -l Git -d 'Do not show ignored git files and show git status' | ||
complete -c lsr -s g -l git-status -d 'Show git status for entries' | ||
complete -c lsr -s i -l git-ignored -d 'Ignore git ignored files' | ||
complete -c lsr -s l -l long -d 'Use long format' | ||
complete -c lsr -s r -l recursive -d 'Show in tree format' | ||
complete -c lsr -s f -l filter -d 'Filter out files using lua filters (`L_filters` in lsr.lua)' | ||
complete -c lsr -s v -l version -d 'Print the current version' | ||
complete -c lsr -s h -l help -d 'Print help message' | ||
complete -c lsr -l completions -d 'Generate shell completions' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
Dec 15 11:09 [33m --- [36m jonathan [0m[34m .[0m | ||
Dec 12 00:13 [33m --- [36m jonathan [0m[34m ..[0m | ||
Nov 07 09:07 [33m --- [36m jonathan [0m[34m .cache[0m | ||
Dec 15 11:22 [33m --- [36m jonathan [0m[34m .git[0m | ||
Nov 07 09:01 [33m --- [36m jonathan [0m[34m .github[0m | ||
Nov 30 21:57 [33m --- [36m jonathan [0m[34m assets[0m | ||
Dec 15 10:52 [33m --- [36m jonathan [0m[34m build[0m | ||
Nov 24 21:27 [33m --- [36m jonathan [0m[34m completions[0m | ||
Dec 13 17:35 [33m --- [36m jonathan [0m[34m include[0m | ||
Dec 11 22:34 [33m --- [36m jonathan [0m[34m lua[0m | ||
Dec 15 11:22 [33m --- [36m jonathan [0m[34m scripts[0m | ||
Dec 15 10:52 [33m --- [36m jonathan [0m[34m src[0m | ||
Oct 13 18:24 [33m 863 B [36m jonathan [0m[90m .clang-format[0m | ||
Nov 30 21:57 [33m 72 B [36m jonathan [0m[90m .gitignore[0m | ||
Dec 15 10:45 [33m 110 B [36m jonathan [0m[90m .quickmarks[0m | ||
Dec 13 16:40 [33m 2.47 KB [36m jonathan [0m[38m CMakeLists.txt[0m | ||
Dec 12 23:07 [33m 7.81 KB [36m jonathan [0m[38m CONFIGURATION.md[0m | ||
Nov 30 21:57 [33m 5.40 KB [36m jonathan [0m[38m CONTRIBUTING.md[0m | ||
Dec 13 16:40 [33m 938 B [36m jonathan [0m[38m FindLibgit2.cmake[0m | ||
Nov 24 21:27 [33m 1.05 KB [36m jonathan [0m[38m LICENSE[0m | ||
Dec 15 11:09 [33m 4.18 KB [36m jonathan [0m[38m README.md[0m | ||
Nov 30 21:57 [33m 910 B [36m jonathan [0m[38m cmake_uninstall.cmake.in[0m | ||
Dec 08 16:53 [33m 5.68 KB [36m jonathan [0m[38m compile_commands.json[0m | ||
Dec 15 10:53 [33m 230 B [36m jonathan [0m[38m todo[0m | ||
#compdef lsr | ||
autoload -U is-at-least | ||
_lsr() { | ||
_arguments -s \ | ||
'(-a --all)'{-a,--all}'[Show all entries, including hidden]' \ | ||
'(-F --Files)'{-F,--Files}'[Show files only]' \ | ||
'(-D --Directories)'{-D,--Directories}'[Show directories only]' \ | ||
'(-S --Symlinks)'{-S,--Symlinks}'[Show symlinks only]' \ | ||
'(-G --Git)'{-G,--Git}'[Do not show ignored git files and show git status]' \ | ||
'(-g --git-status)'{-g,--git-status}'[Show git status for entries]' \ | ||
'(-i --git-ignored)'{-i,--git-ignored}'[Ignore git ignored files]' \ | ||
'(-l --long)'{-l,--long}'[Use long format]' \ | ||
'(-r --recursive)'{-r,--recursive}'[Show in tree format]' \ | ||
'(-f --filter)'{-f,--filter}'[Filter out files using lua filters (`L_filters` in lsr.lua)]' \ | ||
'(-v --version)'{-v,--version}'[Print the current version]' \ | ||
'(-h --help)'{-h,--help}'[Print help message]' \ | ||
'--completions[Generate shell completions]' \ | ||
'*:file:_files' | ||
} | ||
compdef _lsr lsr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters