mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 23:11:14 -03:00
Run fish_indent on share/**.fish
This commit is contained in:
@@ -10,6 +10,6 @@ function __fish_complete_clang
|
||||
set -l clang (commandline -o)[1]
|
||||
# first get the completions from clang, with the prefix separated from the value by a comma
|
||||
$clang --autocomplete=(commandline -ct | string unescape | string replace -- "$prefix" "$prefix,") 2>/dev/null |
|
||||
# and put it in a format that fish understands
|
||||
string replace -r -- '^([^ ]+)\s*(.*)' "$prefix\$1\t\$2"
|
||||
# and put it in a format that fish understands
|
||||
string replace -r -- '^([^ ]+)\s*(.*)' "$prefix\$1\t\$2"
|
||||
end
|
||||
|
||||
@@ -18,124 +18,123 @@ end
|
||||
|
||||
function __fish_complete_mount_opts
|
||||
set -l fish_mount_opts\
|
||||
async\t'Use asynchronous I/O'\
|
||||
atime\t'Update time on each access'\
|
||||
noatime\t'Do not update time on each access'\
|
||||
auto\t'Mounted with'\
|
||||
noauto\t'Not mounted by -a'\
|
||||
defaults\t'Use default options'\
|
||||
dev\t'Interpret character/block special devices'\
|
||||
nodev\t'Do not interpret character/block special devices'\
|
||||
diratime\t'Update directory inode access time'\
|
||||
nodiratime\t'Don\'t update directory inode access time'\
|
||||
dirsync\t'Use synchronous directory operations'\
|
||||
exec\t'Permit executables'\
|
||||
noexec\t'Do not permit executables'\
|
||||
group\t'Any user within device group may mount'\
|
||||
iversion\t'Increment i_version field on inode modification'\
|
||||
noiversion\t'Don\'t increment i_version field on inode modification'\
|
||||
mand\t'Allow mandatory locks'\
|
||||
nomand\t'Don\'t allow mandatory locks'\
|
||||
_netdev\t'Filesystem uses network'\
|
||||
nofail\t'Don\'t report errors'\
|
||||
relatime\t'Update inode access times'\
|
||||
norelatime\t'Don\'t update inode access times'\
|
||||
strictatime\
|
||||
nostrictatime\
|
||||
lazytime\
|
||||
nolazytime\
|
||||
suid\t'Allow suid bits'\
|
||||
nosuid\t'Ignore suid bits'\
|
||||
silent\
|
||||
loud\
|
||||
owner\
|
||||
remount\t'Remount read-only filesystem'\
|
||||
ro\t'Mount read-only'\
|
||||
rw\t'Mount read-write'\
|
||||
sync\t'Use synchronous I/O'\
|
||||
user\t'Any user may mount'\
|
||||
nouser\t'Only root may mount'\
|
||||
users\t'Any user may mount and unmount'\
|
||||
protect\
|
||||
usemp\
|
||||
verbose\
|
||||
{grp,no,usr,}quota\
|
||||
autodefrag\
|
||||
compress\
|
||||
compress-force\
|
||||
degraded\
|
||||
discard\
|
||||
enospc_debug\
|
||||
flushoncommit\
|
||||
inode_cache\
|
||||
context=\t'Set SELinux context'\
|
||||
uid=\
|
||||
gid=\
|
||||
ownmask=\
|
||||
othmask=\
|
||||
setuid=\
|
||||
setgid=\
|
||||
mode=\
|
||||
prefix=\
|
||||
volume=\
|
||||
reserved=\
|
||||
root=\
|
||||
bs=\
|
||||
alloc_start=\
|
||||
check_int{,_data,_print,_mask}=\
|
||||
commit=\
|
||||
compress=\
|
||||
compress-force=\
|
||||
device=\
|
||||
fatal_errors=\
|
||||
max_inline=\
|
||||
metadata_ratio=\
|
||||
noacl\
|
||||
nobarrier\
|
||||
nodatacow\
|
||||
nodatasum\
|
||||
notreelog\
|
||||
recovery\
|
||||
rescan_uuid_tree\
|
||||
skip_balance\
|
||||
nospace_cache\
|
||||
clear_cache\
|
||||
ssd\
|
||||
nossd\
|
||||
ssd_spread\
|
||||
subvol=\
|
||||
subvolrootid=\
|
||||
thread_pool=\
|
||||
user_subvol_rm_allowed\
|
||||
acl\
|
||||
noacl\
|
||||
bsddf\
|
||||
minixdf\
|
||||
check=none\
|
||||
nocheck\
|
||||
debug\
|
||||
errors={continue,remount-ro,panic}\
|
||||
grpid\
|
||||
bsdgroups\
|
||||
bsdgroups\
|
||||
bsdgroups\
|
||||
nouid32\
|
||||
grpquota\
|
||||
grpquota\
|
||||
resgid=\
|
||||
resuid=\
|
||||
sb=\
|
||||
{user,nouser}_xattr\
|
||||
journal={update,unum}\
|
||||
journal{_dev,_path}=\
|
||||
norecovery\
|
||||
noload\
|
||||
data={journal,ordered,writeback}\
|
||||
data_err={ignore,abort}\
|
||||
barrier={0,1}\
|
||||
user_xattr\
|
||||
acl\
|
||||
|
||||
async\t'Use asynchronous I/O'\
|
||||
atime\t'Update time on each access'\
|
||||
noatime\t'Do not update time on each access'\
|
||||
auto\t'Mounted with'\
|
||||
noauto\t'Not mounted by -a'\
|
||||
defaults\t'Use default options'\
|
||||
dev\t'Interpret character/block special devices'\
|
||||
nodev\t'Do not interpret character/block special devices'\
|
||||
diratime\t'Update directory inode access time'\
|
||||
nodiratime\t'Don\'t update directory inode access time'\
|
||||
dirsync\t'Use synchronous directory operations'\
|
||||
exec\t'Permit executables'\
|
||||
noexec\t'Do not permit executables'\
|
||||
group\t'Any user within device group may mount'\
|
||||
iversion\t'Increment i_version field on inode modification'\
|
||||
noiversion\t'Don\'t increment i_version field on inode modification'\
|
||||
mand\t'Allow mandatory locks'\
|
||||
nomand\t'Don\'t allow mandatory locks'\
|
||||
_netdev\t'Filesystem uses network'\
|
||||
nofail\t'Don\'t report errors'\
|
||||
relatime\t'Update inode access times'\
|
||||
norelatime\t'Don\'t update inode access times'\
|
||||
strictatime\
|
||||
nostrictatime\
|
||||
lazytime\
|
||||
nolazytime\
|
||||
suid\t'Allow suid bits'\
|
||||
nosuid\t'Ignore suid bits'\
|
||||
silent\
|
||||
loud\
|
||||
owner\
|
||||
remount\t'Remount read-only filesystem'\
|
||||
ro\t'Mount read-only'\
|
||||
rw\t'Mount read-write'\
|
||||
sync\t'Use synchronous I/O'\
|
||||
user\t'Any user may mount'\
|
||||
nouser\t'Only root may mount'\
|
||||
users\t'Any user may mount and unmount'\
|
||||
protect\
|
||||
usemp\
|
||||
verbose\
|
||||
{grp,no,usr,}quota\
|
||||
autodefrag\
|
||||
compress\
|
||||
compress-force\
|
||||
degraded\
|
||||
discard\
|
||||
enospc_debug\
|
||||
flushoncommit\
|
||||
inode_cache\
|
||||
context=\t'Set SELinux context'\
|
||||
uid=\
|
||||
gid=\
|
||||
ownmask=\
|
||||
othmask=\
|
||||
setuid=\
|
||||
setgid=\
|
||||
mode=\
|
||||
prefix=\
|
||||
volume=\
|
||||
reserved=\
|
||||
root=\
|
||||
bs=\
|
||||
alloc_start=\
|
||||
check_int{,_data,_print,_mask}=\
|
||||
commit=\
|
||||
compress=\
|
||||
compress-force=\
|
||||
device=\
|
||||
fatal_errors=\
|
||||
max_inline=\
|
||||
metadata_ratio=\
|
||||
noacl\
|
||||
nobarrier\
|
||||
nodatacow\
|
||||
nodatasum\
|
||||
notreelog\
|
||||
recovery\
|
||||
rescan_uuid_tree\
|
||||
skip_balance\
|
||||
nospace_cache\
|
||||
clear_cache\
|
||||
ssd\
|
||||
nossd\
|
||||
ssd_spread\
|
||||
subvol=\
|
||||
subvolrootid=\
|
||||
thread_pool=\
|
||||
user_subvol_rm_allowed\
|
||||
acl\
|
||||
noacl\
|
||||
bsddf\
|
||||
minixdf\
|
||||
check=none\
|
||||
nocheck\
|
||||
debug\
|
||||
errors={continue,remount-ro,panic}\
|
||||
grpid\
|
||||
bsdgroups\
|
||||
bsdgroups\
|
||||
bsdgroups\
|
||||
nouid32\
|
||||
grpquota\
|
||||
grpquota\
|
||||
resgid=\
|
||||
resuid=\
|
||||
sb=\
|
||||
{user,nouser}_xattr\
|
||||
journal={update,unum}\
|
||||
journal{_dev,_path}=\
|
||||
norecovery\
|
||||
noload\
|
||||
data={journal,ordered,writeback}\
|
||||
data_err={ignore,abort}\
|
||||
barrier={0,1}\
|
||||
user_xattr\
|
||||
acl\
|
||||
|
||||
set -l token (commandline -tc | string replace -r '^-o' -- '')
|
||||
set -l args (string split , -- $token)
|
||||
|
||||
@@ -34,7 +34,7 @@ function __fish_tshark_decode_as
|
||||
else if string match -rq -- '(==|,)' $tok
|
||||
set -l tok_no_comma (string replace -r -- ',.*$' '' $tok)
|
||||
command tshark -d (string replace -r -- '^-d' '' $tok) 2>|
|
||||
string replace -rf -- "^\t(\S+) \(?([^\)]*)\)?\$" "$tok_no_comma,\$1\t\$2"
|
||||
string replace -rf -- "^\t(\S+) \(?([^\)]*)\)?\$" "$tok_no_comma,\$1\t\$2"
|
||||
else
|
||||
command tshark -d . 2>| string replace -rf -- "^\t(\S+) \(?([^\)]*)\)?\$" '$1==\t$2'
|
||||
end
|
||||
|
||||
@@ -2,8 +2,8 @@ function __fish_print_commands --description "Print a list of documented fish co
|
||||
if test -d $__fish_data_dir/man/man1/
|
||||
for file in $__fish_data_dir/man/man1/**.1*
|
||||
string replace -r '.*/' '' -- $file |
|
||||
string replace -r '.1(.gz)?$' '' |
|
||||
string match -rv '^fish-(?:completions|doc|tutorial|faq)$'
|
||||
string replace -r '.1(.gz)?$' '' |
|
||||
string match -rv '^fish-(?:completions|doc|tutorial|faq)$'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -112,20 +112,20 @@ function __fish_print_help --description "Print help message for the specified f
|
||||
end
|
||||
end
|
||||
end | string replace -ra '^ ' '' | ul | # post-process with `ul`, to interpret the old-style grotty escapes
|
||||
begin
|
||||
set -l pager less
|
||||
set -q PAGER
|
||||
and echo $PAGER | read -at pager
|
||||
not isatty stdout
|
||||
and set pager cat # cannot use a builtin here
|
||||
# similar to man, but add -F to quit paging when the help output is brief (#6227)
|
||||
set -xl LESS isrFX
|
||||
# less options:
|
||||
# -i (--ignore-case) search case-insensitively, like man
|
||||
# -s (--squeeze-blank-lines) not strictly necessary since we already do that above
|
||||
# -r (--raw-control-chars) to display bold, underline and colors
|
||||
# -F (--quit-if-one-screen) to maintain the non-paging behavior for small outputs
|
||||
# -X (--no-init) not sure if this is needed but git uses it
|
||||
$pager
|
||||
end
|
||||
begin
|
||||
set -l pager less
|
||||
set -q PAGER
|
||||
and echo $PAGER | read -at pager
|
||||
not isatty stdout
|
||||
and set pager cat # cannot use a builtin here
|
||||
# similar to man, but add -F to quit paging when the help output is brief (#6227)
|
||||
set -xl LESS isrFX
|
||||
# less options:
|
||||
# -i (--ignore-case) search case-insensitively, like man
|
||||
# -s (--squeeze-blank-lines) not strictly necessary since we already do that above
|
||||
# -r (--raw-control-chars) to display bold, underline and colors
|
||||
# -F (--quit-if-one-screen) to maintain the non-paging behavior for small outputs
|
||||
# -X (--no-init) not sure if this is needed but git uses it
|
||||
$pager
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,16 +11,16 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
|
||||
test -r /etc/hosts && read -z </etc/hosts
|
||||
or type -q getent && getent hosts 2>/dev/null
|
||||
end |
|
||||
# Ignore comments, own IP addresses (127.*, 0.0[.0[.0]], ::1), non-host IPs (fe00::*, ff00::*),
|
||||
# and leading/trailing whitespace. Split results on whitespace to handle multiple aliases for
|
||||
# one IP.
|
||||
string replace -irf '^\s*?(?!(?:#|0\.|127\.|ff0|fe0|::1))\S+\s*(.*?)\s*$' '$1' |
|
||||
string split ' '
|
||||
# Ignore comments, own IP addresses (127.*, 0.0[.0[.0]], ::1), non-host IPs (fe00::*, ff00::*),
|
||||
# and leading/trailing whitespace. Split results on whitespace to handle multiple aliases for
|
||||
# one IP.
|
||||
string replace -irf '^\s*?(?!(?:#|0\.|127\.|ff0|fe0|::1))\S+\s*(.*?)\s*$' '$1' |
|
||||
string split ' '
|
||||
|
||||
# Print nfs servers from /etc/fstab
|
||||
if test -r /etc/fstab
|
||||
string match -r '^\s*[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3]:|^[a-zA-Z\.]*:' </etc/fstab |
|
||||
string replace -r ':.*' ''
|
||||
string replace -r ':.*' ''
|
||||
end
|
||||
|
||||
# Check hosts known to ssh.
|
||||
@@ -121,17 +121,17 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
|
||||
read -z <$file
|
||||
end
|
||||
end |
|
||||
# Ignore hosts that are hashed, commented or @-marked and strip the key
|
||||
# Handle multiple comma-separated hostnames sharing a key, too.
|
||||
#
|
||||
# This one regex does everything we need, finding all matches including comma-separated
|
||||
# values, but fish does not let us print only a capturing group without the entire match,
|
||||
# and we can't use `string replace` instead (because CSV then fails).
|
||||
# string match -ar "(?:^|,)(?![@|*!])\[?([^ ,:\]]+)\]?"
|
||||
#
|
||||
# Instead, manually piece together the regular expressions
|
||||
string match -v -r '^\s*[!*|@#]' | string replace -rf '^\s*(\S+) .*' '$1' |
|
||||
string split ',' | string replace -r '\[?([^\]]+).*' '$1'
|
||||
# Ignore hosts that are hashed, commented or @-marked and strip the key
|
||||
# Handle multiple comma-separated hostnames sharing a key, too.
|
||||
#
|
||||
# This one regex does everything we need, finding all matches including comma-separated
|
||||
# values, but fish does not let us print only a capturing group without the entire match,
|
||||
# and we can't use `string replace` instead (because CSV then fails).
|
||||
# string match -ar "(?:^|,)(?![@|*!])\[?([^ ,:\]]+)\]?"
|
||||
#
|
||||
# Instead, manually piece together the regular expressions
|
||||
string match -v -r '^\s*[!*|@#]' | string replace -rf '^\s*(\S+) .*' '$1' |
|
||||
string split ',' | string replace -r '\[?([^\]]+).*' '$1'
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
@@ -255,7 +255,7 @@ function __fish_print_packages
|
||||
end
|
||||
end
|
||||
# prints: <package name> Package
|
||||
xbps-query -Rsl | sed 's/^... \([^ ]*\)-.* .*/\1/; s/$/\t'Package'/' > $cache_file &
|
||||
xbps-query -Rsl | sed 's/^... \([^ ]*\)-.* .*/\1/; s/$/\t'Package'/' >$cache_file &
|
||||
return
|
||||
else
|
||||
xbps-query -l | sed 's/^.. \([^ ]*\)-.* .*/\1/' # TODO: actually put package versions in tab for locally installed packages
|
||||
|
||||
@@ -663,7 +663,8 @@ function __fish_git_prompt_set_char
|
||||
end
|
||||
|
||||
if set -q argv[3]
|
||||
and begin set -q __fish_git_prompt_show_informative_status
|
||||
and begin
|
||||
set -q __fish_git_prompt_show_informative_status
|
||||
or set -q __fish_git_prompt_use_informative_chars
|
||||
end
|
||||
set char $argv[3]
|
||||
|
||||
@@ -25,7 +25,7 @@ function fish_prompt --description 'Write out the prompt'
|
||||
end
|
||||
|
||||
# Write pipestatus
|
||||
set -l bold_flag '--bold'
|
||||
set -l bold_flag --bold
|
||||
if test $__fish_prompt_status_generation = $status_generation
|
||||
set bold_flag
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user