diff options
author | EuAndreh <eu@euandre.org> | 2022-12-03 06:29:10 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-12-03 06:29:10 -0300 |
commit | 80ec06535e4ec27f63990c517a90da10b6228937 (patch) | |
tree | f34c606863ff11da427cb071abab79289d300642 /bin/vm | |
parent | etc/ssh/known_hosts: Add Ubuntu VM key (diff) | |
download | dotfiles-80ec06535e4ec27f63990c517a90da10b6228937.tar.gz dotfiles-80ec06535e4ec27f63990c517a90da10b6228937.tar.xz |
bin/vm: Bail out when given a bad prefix
Diffstat (limited to 'bin/vm')
-rwxr-xr-x | bin/vm | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -144,6 +144,11 @@ guess_name() { sed 's/^/- /' >&2 exit 2 fi + if [ -z "$IMAGES" ]; then + printf 'Cannot guess name with the given prefix: "%s".\n' "$PREFIX" >&2 + printf '\nNo possibilities were found.\n' >&2 + exit 2 + fi printf '%s\n' "$(basename "$IMAGES" .qcow2)" } |