From: Eric Cook <llua@gmx.com>
To: zsh-workers@zsh.org
Subject: [PATCH] _ncftp: search XDG_DATA_HOME for bookmarks saved by lftp
Date: Mon, 10 Aug 2015 20:49:30 -0400 [thread overview]
Message-ID: <1439254170-4659-1-git-send-email-llua@gmx.com> (raw)
---
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
reply other threads:[~2015-08-11 0:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1439254170-4659-1-git-send-email-llua@gmx.com \
--to=llua@gmx.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).