Skip to content

Commit

Permalink
initi
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Jun 12, 2019
0 parents commit 7e15613
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions gen.bash
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

passname="$1"
user="$2"

cry () {
echo "$0 <pass-name> [user-name]"
exit 1
}

if [ "$passname" == "-h" ] || [ "$passname" == "--help" ]; then
cry
fi

if [ -z "$passname" ]; then
cry
fi

password=$(getpassword)
userline=""

if [ ! -z "$user" ]; then
userline="user: $user"
fi

echo "$password
$userline" | pbcopy

pass edit $passname

echo -n $password | pbcopy

$HOME/bin/sync

0 comments on commit 7e15613

Please sign in to comment.