Further bash-completion work
This commit is contained in:
@@ -22,7 +22,7 @@ _sns_complete_entries () {
|
||||
|
||||
local IFS=$'\n'
|
||||
local items=($(compgen -f $prefix$cur))
|
||||
for item in ${items[@]}; do
|
||||
for item in "${items[@]}"; do
|
||||
[[ $item =~ /\.[^/]*$ ]] && continue
|
||||
|
||||
# if there is a unique match, and it is a directory with one entry
|
||||
@@ -56,7 +56,7 @@ _sns_complete_folders () {
|
||||
|
||||
local IFS=$'\n'
|
||||
local items=($(compgen -d $prefix$cur))
|
||||
for item in ${items[@]}; do
|
||||
for item in "${items[@]}"; do
|
||||
[[ $item == $prefix.* ]] && continue
|
||||
COMPREPLY+=("${item#$prefix}/")
|
||||
done
|
||||
@@ -77,9 +77,10 @@ _sns()
|
||||
if [[ $COMP_CWORD -gt 1 ]]; then
|
||||
local lastarg="${COMP_WORDS[$COMP_CWORD-1]}"
|
||||
case "${COMP_WORDS[1]}" in
|
||||
--list)
|
||||
--list|-l)
|
||||
_sns_complete_folders
|
||||
--edit|--print)
|
||||
;;
|
||||
--edit|-e|--print|-p|--delete|-d)
|
||||
_sns_complete_entries
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -15,7 +15,7 @@ fi
|
||||
|
||||
if [ "$ENCRYPTION" == "TRUE" ]; then
|
||||
SESSION_ID="$RANDOM" #SESSION_ID later becomes the temporary filename
|
||||
readonly NOTE="$NOTE.$EXT.gpg"
|
||||
readonly NOTE="$NOTE.gpg.$EXT"
|
||||
else
|
||||
readonly NOTE="$NOTE.$EXT"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user