Added config option

This commit is contained in:
Jon-William Lewis
2016-08-14 13:19:07 -05:00
parent 687e7b59e4
commit a10aca70dc
5 changed files with 11 additions and 514 deletions

View File

@@ -74,7 +74,7 @@ _sns()
{
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
local commands="--create --delete --edit --help --print --list --init\
local commands="--create --config --delete --edit --help --print --list --init\
-c -d -e -h -p -l -i"
if [[ $COMP_CWORD -gt 1 ]]; then
local lastarg="${COMP_WORDS[$COMP_CWORD-1]}"

View File

@@ -105,6 +105,15 @@ else
CREATE="TRUE"
OP="TRUE"
;;
--config)
if [ -z "$EDITOR" ]; then
printf "$YELLOW_COLOR!$RESET_COLOR - %s\n"\
"No editor defined. Defaulting to vi."
EDITOR=vi
fi
"$EDITOR" "$CONFIG_FILE"
exit 0;
;;
-d|--delete)
DELETE="TRUE"
OP="TRUE"