Add possibility to define greeting function, suggested by Chris Miller

darcs-hash:20090216210450-ac50b-9b4f7c5bf45afaf21d51e46ff8c2b11d171fcbf2.gz
This commit is contained in:
axel 2009-02-17 07:04:50 +10:00
parent 79784d3e18
commit 07717a3570
2 changed files with 16 additions and 6 deletions

View file

@ -1256,6 +1256,12 @@ end
</pre> </pre>
</p> </p>
\subsection greeting Configurable greeting
If a function named fish_greeting exists after initialization, it will
be run when entering interactive mode. Otherwise,if an environment
variable named fish_greeting exists, it will be printed.
\subsection event Event handlers \subsection event Event handlers
When defining a new function in fish, it is possible to make it into an When defining a new function in fish, it is possible to make it into an

View file

@ -146,6 +146,9 @@ function __fish_config_interactive -d "Initializations that should be performed
# Print a greeting # Print a greeting
# #
if functions -q fish_greeting
fish_greeting
else
if set -q fish_greeting if set -q fish_greeting
switch $fish_greeting switch $fish_greeting
case '' case ''
@ -155,6 +158,7 @@ function __fish_config_interactive -d "Initializations that should be performed
echo $fish_greeting echo $fish_greeting
end end
end end
end
# #
# Set exit message # Set exit message