Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _ncftp: search XDG_DATA_HOME for bookmarks saved by lftp
- X-seq: zsh-workers 36091
- From: Eric Cook <llua@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _ncftp: search XDG_DATA_HOME for bookmarks saved by lftp
- Date: Mon, 10 Aug 2015 20:49:30 -0400
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
Completion/Unix/Command/_ncftp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Completion/Unix/Command/_ncftp b/Completion/Unix/Command/_ncftp
index 93de404..763a613 100644
--- a/Completion/Unix/Command/_ncftp
+++ b/Completion/Unix/Command/_ncftp
@@ -1,6 +1,12 @@
#compdef ncftp lftp
-local expl bookmarks=$HOME/.$service/bookmarks
+local expl bookmarks XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
+
+if [[ $service = lftp ]]; then
+ bookmarks=$XDG_DATA_HOME/$service/bookmarks
+else
+ bookmarks=$HOME/.$service/bookmarks
+fi
if [[ -f $bookmarks ]]; then
bookmarks=(${"${(f)$(<$bookmarks)}"%%[[:space:],]*})
--
2.5.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author