Merge pull request #16 from robbydyer/master

Allow CLI arg for r/w/d
This commit is contained in:
drduh 2015-07-30 23:30:52 -04:00
commit 3e94bc0ce8
2 changed files with 8 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
pwd.sh.safe

9
pwd.sh
View File

@ -160,8 +160,13 @@ sanity_check () {
sanity_check
read -n 1 -p "Read, write, or delete password? (r/w/d, default: r) " action
printf "\n"
if [ -z ${1+x} ]
then
read -n 1 -p "Read, write, or delete password? (r/w/d, default: r) " action
printf "\n"
else
action="$1"
fi
if [[ "${action}" =~ ^([wW])$ ]] ; then
create_username && write_pass