cleanup copy/type custom command logic
This commit is contained in:
parent
869c5450bd
commit
6de507d9d7
20
wofi-pass
20
wofi-pass
@ -93,14 +93,8 @@ while true; do
|
|||||||
--copy )
|
--copy )
|
||||||
copyisset=1
|
copyisset=1
|
||||||
if [ -n "$2" ]; then
|
if [ -n "$2" ]; then
|
||||||
if command -v "$2"; then
|
copy_cmd="$2"
|
||||||
echo "$2"
|
shift 2
|
||||||
copy_cmd="$2"
|
|
||||||
else
|
|
||||||
printf "Cannot find %s in path, defaulting to %s.\n" "$2" "$COPY_CMD"
|
|
||||||
copy_cmd="$COPY_CMD"
|
|
||||||
shift 2
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
copy_cmd="$COPY_CMD"
|
copy_cmd="$COPY_CMD"
|
||||||
shift
|
shift
|
||||||
@ -112,14 +106,8 @@ while true; do
|
|||||||
--type )
|
--type )
|
||||||
typeisset=1
|
typeisset=1
|
||||||
if [ -n "$2" ]; then
|
if [ -n "$2" ]; then
|
||||||
if command -v "$2"; then
|
type_cmd="$2"
|
||||||
echo "$2"
|
shift 2
|
||||||
type_cmd="$2"
|
|
||||||
else
|
|
||||||
printf "Cannot find %s in path, defaulting to %s.\n" "$2" "$TYPE_CMD"
|
|
||||||
type_cmd="$TYPE_CMD"
|
|
||||||
shift 2
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
type_cmd="$TYPE_CMD"
|
type_cmd="$TYPE_CMD"
|
||||||
shift
|
shift
|
||||||
|
Reference in New Issue
Block a user