Corrections to bash completion to match new location of SNS store

This commit is contained in:
Jon-William Lewis
2016-07-23 03:32:46 -05:00
parent 755c248f93
commit 568e2a6dbe

View File

@@ -16,7 +16,7 @@
# This file is licensed under the GPLv2+. Please see COPYING for more information. # This file is licensed under the GPLv2+. Please see COPYING for more information.
_sns_complete_entries () { _sns_complete_entries () {
prefix="${SNS_STORE_DIR:-$HOME/.config/sns/notes/}" prefix="${SNS_STORE_DIR:-$HOME/.local/sns/notes/}"
suffix=".note" suffix=".note"
autoexpand=${1:-0} autoexpand=${1:-0}
@@ -53,7 +53,7 @@ _sns_complete_entries () {
} }
_sns_complete_folders () { _sns_complete_folders () {
prefix="${SNS_STORE_DIR:-$HOME/.config/sns/notes/}" prefix="${SNS_STORE_DIR:-$HOME/.local/sns/notes/}"
local IFS=$'\n' local IFS=$'\n'
local items=($(compgen -d $prefix$cur)) local items=($(compgen -d $prefix$cur))
@@ -74,7 +74,8 @@ _sns()
{ {
COMPREPLY=() COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}" local cur="${COMP_WORDS[COMP_CWORD]}"
local commands="--create --delete --edit --help --print --list --init" local commands="--create --delete --edit --help --print --list --init\
-c -d -e -h -p -l -i"
if [[ $COMP_CWORD -gt 1 ]]; then if [[ $COMP_CWORD -gt 1 ]]; then
local lastarg="${COMP_WORDS[$COMP_CWORD-1]}" local lastarg="${COMP_WORDS[$COMP_CWORD-1]}"
case "${COMP_WORDS[1]}" in case "${COMP_WORDS[1]}" in