diff options
-rwxr-xr-x | keyringer | 10 | ||||
-rwxr-xr-x | lib/keyringer/actions/shell | 3 |
2 files changed, 9 insertions, 4 deletions
@@ -162,12 +162,14 @@ source "$LIB" || exit 1 # Setup main configuration and load preferences keyringer_config_load -if [ -z "$ACTION" ]; then +# Dispatch +if [ -z "$KEYRING" ]; then keyringer_usage exit 1 -fi - -if [ "$ACTION" == "init" ]; then +elif [ -z "$ACTION" ]; then + # Run shell if no action were given + keyringer $KEYRING shell +elif [ "$ACTION" == "init" ]; then keyringer_init $* elif keyringer_has_action "$ACTION"; then keyringer_dispatch $* diff --git a/lib/keyringer/actions/shell b/lib/keyringer/actions/shell index 955dfe8..ab170b1 100755 --- a/lib/keyringer/actions/shell +++ b/lib/keyringer/actions/shell @@ -10,6 +10,9 @@ source "$LIB" || exit 1 # Basic parameters SHELLPATH="/" +# Show usage +keyringer_usage $KEYRING + # While a "quit" command isn't entered, read STDIN while read -rep "keyringer:/${KEYRING}${SHELLPATH}> " STDIN; do if [ "$STDIN" == "quit" ] || [ "$STDIN" == "exit" ] || [ "$STDIN" == "bye" ]; then |