mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 14:43:55 +08:00
fish_indent: Cleanup all *.fish files not in tests
This commit is contained in:
parent
add0a9dfcd
commit
9eee1b4499
|
@ -1,8 +1,8 @@
|
||||||
complete -f brightnessctl
|
complete -f brightnessctl
|
||||||
complete -c brightnessctl -n "test (__fish_number_of_cmd_args_wo_opts) = 1" -a "info" -d "Get device info"
|
complete -c brightnessctl -n "test (__fish_number_of_cmd_args_wo_opts) = 1" -a info -d "Get device info"
|
||||||
complete -c brightnessctl -n "test (__fish_number_of_cmd_args_wo_opts) = 1" -a "get" -d "Get current brightness of device"
|
complete -c brightnessctl -n "test (__fish_number_of_cmd_args_wo_opts) = 1" -a get -d "Get current brightness of device"
|
||||||
complete -c brightnessctl -n "test (__fish_number_of_cmd_args_wo_opts) = 1" -a "set" -d "Get maximum brightness of device"
|
complete -c brightnessctl -n "test (__fish_number_of_cmd_args_wo_opts) = 1" -a set -d "Get maximum brightness of device"
|
||||||
complete -c brightnessctl -n "test (__fish_number_of_cmd_args_wo_opts) = 1" -a "max" -d "Set brightness of device"
|
complete -c brightnessctl -n "test (__fish_number_of_cmd_args_wo_opts) = 1" -a max -d "Set brightness of device"
|
||||||
|
|
||||||
complete -c brightnessctl -s h -l help -d "Print help and exit"
|
complete -c brightnessctl -s h -l help -d "Print help and exit"
|
||||||
complete -c brightnessctl -s l -l list -d "List devices with available brightness controls"
|
complete -c brightnessctl -s l -l list -d "List devices with available brightness controls"
|
||||||
|
|
|
@ -19,11 +19,10 @@ function __fish_print_magento_modules -d "Lists all Magento modules"
|
||||||
test -f $config_path; or return
|
test -f $config_path; or return
|
||||||
|
|
||||||
set -l in_modules 0
|
set -l in_modules 0
|
||||||
cat $config_path | \
|
cat $config_path | while read -l line
|
||||||
while read -l line
|
|
||||||
if test "$in_modules" -eq 0
|
if test "$in_modules" -eq 0
|
||||||
if string match -rq '[\'"]modules[\'"]\s*=>.*\[' -- $line
|
if string match -rq '[\'"]modules[\'"]\s*=>.*\[' -- $line
|
||||||
set in_modules 1;
|
set in_modules 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if string match -rq '^\s*]\s*,\s*$' -- $line
|
if string match -rq '^\s*]\s*,\s*$' -- $line
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# TODO: Make this work with completions that have their description appended after a \t
|
# TODO: Make this work with completions that have their description appended after a \t
|
||||||
|
|
||||||
function __fish_concat_completions -d "Generate completions that are specified as comma-separated values from stdin source"
|
function __fish_concat_completions -d "Generate completions that are specified as comma-separated values from stdin source"
|
||||||
type -q awk || return;
|
type -q awk || return
|
||||||
|
|
||||||
set -l token (commandline -ct)
|
set -l token (commandline -ct)
|
||||||
# We want to filter out suggestions the user has already entered.
|
# We want to filter out suggestions the user has already entered.
|
||||||
|
@ -13,8 +13,8 @@ function __fish_concat_completions -d "Generate completions that are specified a
|
||||||
set -l filter (printf '^%s$\n' (printf '%s\n' $extant | string escape --style=regex) | string join '|')
|
set -l filter (printf '^%s$\n' (printf '%s\n' $extant | string escape --style=regex) | string join '|')
|
||||||
# Work around the insanity of trying to read from stdin within a function. Note that we can't place the
|
# Work around the insanity of trying to read from stdin within a function. Note that we can't place the
|
||||||
# `read` call in between () to capture the output because that breaks its connection to stdin.
|
# `read` call in between () to capture the output because that breaks its connection to stdin.
|
||||||
while read -l line;
|
while read -l line
|
||||||
echo $line;
|
echo $line
|
||||||
end | string match -er '.' | string match -rv -- $filter | string replace -r '^' -- (string replace -rf -- '^(.+),.*$' '$1,' $token; or echo "")
|
end | string match -er '.' | string match -rv -- $filter | string replace -r '^' -- (string replace -rf -- '^(.+),.*$' '$1,' $token; or echo "")
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
|
@ -128,8 +128,10 @@ function fish_config --description "Launch fish's web based configuration"
|
||||||
set have $f
|
set have $f
|
||||||
# Set the functions to empty so we empty the file
|
# Set the functions to empty so we empty the file
|
||||||
# if necessary.
|
# if necessary.
|
||||||
function fish_prompt; end
|
function fish_prompt
|
||||||
function fish_right_prompt; end
|
end
|
||||||
|
function fish_right_prompt
|
||||||
|
end
|
||||||
source $f
|
source $f
|
||||||
or return 2
|
or return 2
|
||||||
end
|
end
|
||||||
|
|
|
@ -36,7 +36,7 @@ function fish_prompt -d "Write out the prompt"
|
||||||
else
|
else
|
||||||
set git_status (set_color green):
|
set git_status (set_color green):
|
||||||
if test -z "$git_branch"
|
if test -z "$git_branch"
|
||||||
set git_branch "-"
|
set git_branch -
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
set git_info "(git$git_status"(set_color -o blue)"$git_branch"(set_color white)")"
|
set git_info "(git$git_status"(set_color -o blue)"$git_branch"(set_color white)")"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user