mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 16:41:41 +08:00
11a60c8374
I hate doing this but I am tired of touching a fish script as part of some change and having `make style` radically change it. Which makes editing fish scripts more painful than it needs to be. It is time to do a wholesale reformatting of these scripts to conform to the documented style as implemented by the `fish_indent` program.
13 lines
720 B
Fish
13 lines
720 B
Fish
function __fish_print_mounted --description 'Print mounted devices'
|
|
if test -r /etc/mtab
|
|
# In mtab, spaces are replaced by a literal '\040'
|
|
# So it's safe to get the second "field" and then replace it
|
|
# \011 encodes a tab, \012 encodes a newline and \\ encodes a backslash
|
|
# This will probably break on newlines because of our splitting, though
|
|
# and tabs because of descriptions
|
|
string replace -r '\S+ (\S+) .*' '$1' </etc/mtab | string replace -a "\040" " " | string replace -a "\011" \t | string replace -a "\012" \n | string replace -a "\\\\" "\\"
|
|
else
|
|
mount | cut -d " " -f 1-3 | tr " " \n | sed -e "s/[0-9\.]*:\//\//" | __fish_sgrep "^/"
|
|
end
|
|
end
|