aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/config.fish
diff options
context:
space:
mode:
authorGravatar Konrad Borowski <glitchmr@myopera.com>2013-08-14 18:43:09 +0300
committerGravatar Konrad Borowski <glitchmr@myopera.com>2013-08-14 18:43:09 +0300
commit5818289c2da8e53b8b52b69064254576ba7d839a (patch)
tree20b55f6c9bcbcdc1f6f4dfec98bcc5436e109480 /share/config.fish
parentd407d680eaea4afb9eef384a003b10c5f6aafcd7 (diff)
Deprecate "." command. Fixes #310.
Needs documentation (for the new name), but manages to move . to source, while preserving compatibility.
Diffstat (limited to 'share/config.fish')
-rw-r--r--share/config.fish13
1 files changed, 13 insertions, 0 deletions
diff --git a/share/config.fish b/share/config.fish
index 056fd34f..e0b07bf9 100644
--- a/share/config.fish
+++ b/share/config.fish
@@ -109,3 +109,16 @@ function __fish_on_interactive --on-event fish_prompt
functions -e __fish_on_interactive
end
+# "." command for compatibility with old fish versions.
+function . --description 'Evaluate contents of file (deprecated, see "source")'
+ if begin
+ test (count $argv) -eq 0
+ # Uses tty directly, as isatty depends on "."
+ and tty 0>&0 >/dev/null
+ end
+ echo "source: '.' command is deprecated, and doesn't work with STDIN anymore. Did you mean 'source' or './'?" >&2
+ return 1
+ else
+ source $argv
+ end
+end