mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Move _ shellscript function to it's own file
darcs-hash:20060221153701-ac50b-05cecdac1221e0abc709d9e9c1799faa7986fa78.gz
This commit is contained in:
parent
5aa019a0b5
commit
328c3a39a1
2 changed files with 20 additions and 21 deletions
26
share/fish
26
share/fish
|
@ -7,28 +7,8 @@
|
|||
#
|
||||
# Assign a temporary value here for performance reasons. The real value should be set in /etc/fish.
|
||||
#
|
||||
set -g fish_function_path
|
||||
|
||||
#
|
||||
# Don't need completions in non-interactive mode
|
||||
#
|
||||
|
||||
#
|
||||
# Alias for gettext (or a fallback if gettext isn't installed) This
|
||||
# needs to be defined here and not in fish_function.fish, since it is
|
||||
# used by other init files.
|
||||
#
|
||||
|
||||
function _ -d "Alias for the gettext command"
|
||||
printf "%s" $argv
|
||||
end
|
||||
if test 1 = "1"
|
||||
if which gettext ^/dev/null >/dev/null
|
||||
function _ -d "Alias for the gettext command"
|
||||
gettext fish $argv
|
||||
end
|
||||
end
|
||||
end
|
||||
set -g fish_function_path $PWD/functions/
|
||||
|
||||
#
|
||||
# Set some value for LANG if nothing was set before, and this is a
|
||||
|
@ -45,6 +25,10 @@ if status --is-login
|
|||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Don't need completions in non-interactive mode
|
||||
#
|
||||
|
||||
if not status --is-interactive
|
||||
exit
|
||||
end
|
||||
|
|
15
share/functions/_.fish
Normal file
15
share/functions/_.fish
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
#
|
||||
# Alias for gettext (or a fallback if gettext isn't installed)
|
||||
#
|
||||
|
||||
if which gettext ^/dev/null >/dev/null
|
||||
function _ -d "Alias for the gettext command"
|
||||
gettext fish $argv
|
||||
end
|
||||
else
|
||||
function _ -d "Alias for the gettext command"
|
||||
printf "%s" $argv
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in a new issue