@@ -11,10 +11,10 @@ err() { echo "$*" >&2; }
|
||||
|
||||
usage() {
|
||||
printf 'Usage: ufwd [flags]\n'
|
||||
printf ' -h # Show this message.\n'
|
||||
printf ' -n # Enable notifications with notify-send. Must be installed.\n'
|
||||
printf ' -d [path] # Set the dir that is to be watched.\n'
|
||||
printf ' -s # Push the file url into the clipboard.\n'
|
||||
printf ' --help|-h # Show this message.\n'
|
||||
printf ' --notify|-n # Enable notifications with notify-send. Must be installed.\n'
|
||||
printf ' --workdir|-d [path] # Set the dir that is to be watched.\n'
|
||||
printf ' --clipboard|-c # Enable clipboard.\n'
|
||||
printf ' --magick <type:format> # Convert files of `type` into `format` with magick.\n'
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ main() {
|
||||
shift
|
||||
done
|
||||
|
||||
[[ $cfg_workdir ]] || cfg_workdir="$XDG_RUNTIME_DIR/ufwd"
|
||||
[[ $cfg_workdir ]] || cfg_workdir=( "$XDG_RUNTIME_DIR/ufwd" )
|
||||
|
||||
if (( flag_enable_notifications )); then
|
||||
if type -P notify-send &>/dev/null; then
|
||||
@@ -87,7 +87,10 @@ main() {
|
||||
fi
|
||||
|
||||
for p in "${cfg_workdir[@]}"; do
|
||||
[[ -d "$p" ]] || return 1
|
||||
[[ -d "$p" ]] || {
|
||||
err "No such directory: $p"
|
||||
return 1
|
||||
}
|
||||
done
|
||||
|
||||
printf 'Working in:\n'
|
||||
|
||||
Reference in New Issue
Block a user