2016-09-11 03:42:52 +00:00
|
|
|
# Note that when a completion file is sourced a new block scope is created so `set -l` works.
|
|
|
|
set -l __fish_history_all_commands search delete save merge clear
|
2016-08-24 00:52:40 +00:00
|
|
|
|
2016-09-11 03:42:52 +00:00
|
|
|
# Note that these options are only valid with the "search" and "delete" subcommands.
|
|
|
|
complete -c history -n '__fish_seen_subcommand_from search delete' \
|
|
|
|
-s p -l prefix -d "Match items beginning with the string"
|
|
|
|
complete -c history -n '__fish_seen_subcommand_from search delete' \
|
|
|
|
-s c -l contains -d "Match items containing the string"
|
|
|
|
complete -c history -n '__fish_seen_subcommand_from search delete' \
|
|
|
|
-s e -l exact -d "Match items identical to the string"
|
|
|
|
complete -c history -n '__fish_seen_subcommand_from search delete' \
|
|
|
|
-s t -l show-time -d "Output with timestamps"
|
2018-04-15 04:45:25 +00:00
|
|
|
complete -c history -n '__fish_seen_subcommand_from search delete' \
|
|
|
|
-s C -l case-sensitive -d "Match items in a case-sensitive manner"
|
2016-09-21 05:32:38 +00:00
|
|
|
complete -c history -n '__fish_seen_subcommand_from search' \
|
2019-09-24 05:43:38 +00:00
|
|
|
-s n -l max -d "Limit output to the first 'n' matches" -x
|
2016-09-11 03:42:52 +00:00
|
|
|
|
|
|
|
# We don't include a completion for the "save" subcommand because it should not be used
|
|
|
|
# interactively.
|
|
|
|
complete -f -c history -n "not __fish_seen_subcommand_from $__fish_history_all_commands" \
|
|
|
|
-a search -d "Prints commands from history matching the strings"
|
|
|
|
complete -f -c history -n "not __fish_seen_subcommand_from $__fish_history_all_commands" \
|
|
|
|
-a delete -d "Deletes commands from history matching the strings"
|
|
|
|
complete -f -c history -n "not __fish_seen_subcommand_from $__fish_history_all_commands" \
|
|
|
|
-a merge -d "Incorporate history changes from other sessions"
|
|
|
|
complete -f -c history -n "not __fish_seen_subcommand_from $__fish_history_all_commands" \
|
|
|
|
-a clear -d "Clears history file"
|