diff options
author | hut <hut@lavabit.com> | 2010-04-01 18:47:06 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-04-01 18:47:06 +0200 |
commit | 8fa8705476d5023083bc27a3fddaee8402ac94e5 (patch) | |
tree | 6a407ea3d5949386ef7008382a0f4bcde0e32c1e | |
parent | 921fa593d056ad791a48570196664ca29f57a8d4 (diff) | |
download | ranger-8fa8705476d5023083bc27a3fddaee8402ac94e5.tar.gz |
reverted a part of 45cf5174. Allow "source ranger ranger" again
This is OK since it comes at almost no cost
-rwxr-xr-x | ranger.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ranger.py b/ranger.py index 1c06f125..636bd384 100755 --- a/ranger.py +++ b/ranger.py @@ -19,15 +19,14 @@ # # ---------------------------------------------------------------------------- # -# An embedded shell script for backwards compatibility. +# An embedded shell script. It allows you to change the directory +# after you exit ranger by starting it with: source ranger ranger """": -echo "Warning: the cd-after-exit feature has been removed." -echo "You can get the functionality by using such a function:" -echo 'ranger() {' -echo ' $(which ranger) $@ &&' -echo ' cd "$(grep \^\'"'"' ~/.ranger/bookmarks | cut -b3-)"' -echo '}' -$1 +if [ $1 ]; then + $@ && cd "$(grep \^\' ~/.ranger/bookmarks | cut -b3-)" +else + echo "usage: source path/to/ranger.py path/to/ranger.py" +fi return 1 """ |