* [PATCH] _ncftp: search XDG_DATA_HOME for bookmarks saved by lftp
@ 2015-08-11 0:49 Eric Cook
0 siblings, 0 replies; only message in thread
From: Eric Cook @ 2015-08-11 0:49 UTC (permalink / raw)
To: zsh-workers
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-08-11 0:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-11 0:49 [PATCH] _ncftp: search XDG_DATA_HOME for bookmarks saved by lftp Eric Cook
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).