Add proper help text to qvm-copy tools and fix incorrect behavior

for qvm-move

Added more descriptive usage text to the
qvm-copy/qvm-move/qvm-copy-to-vm/qvm-move-to-vm family of tools.
Also fixed bug that removed the file being moved for qvm-move-to-vm,
but not for qvm-move.

fixes QubesOS/qubes-issues#3529
fixes QubesOS/qubes-issues#4020
This commit is contained in:
Marta Marczykowska-Górecka 2018-07-15 23:15:38 +02:00
parent f4c10d47da
commit 96d8914c83
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B

View File

@ -22,7 +22,23 @@ set -e
#
if [ $# -lt 2 ] ; then
echo "usage: $0 [--without-progress] dest_vmname file [file]+"
if [ "${0##*/}" = "qvm-move-to-vm" ] || [ "${0##*/}" = "qvm-copy-to-vm" ]; then
echo "usage: $0 [--without-progress] destination_vmname FILE [FILE ...]"
else
echo "usage: $0 [--without-progress] FILE [FILE ...]"
fi
echo
if [ "${0##*/}" = "qvm-move-to-vm" ] || [ "${0##*/}" = "qvm-move" ] ; then
echo "Move FILE to ~/QubesIncoming/$(hostname)/ in the destination qube."
else
echo "Copy FILE to ~/QubesIncoming/$(hostname)/ in the destination qube."
fi
echo
echo "You will be prompted to select the destination qube. If FILE is a directory, it will be copied recursively."
exit 1
fi
@ -49,6 +65,6 @@ fi
/usr/lib/qubes/qrexec-client-vm "$VM" qubes.Filecopy /usr/lib/qubes/qfile-agent "$@"
if [ "${0##*/}" = "qvm-move-to-vm" ]; then
if [ "${0##*/}" = "qvm-move-to-vm" ] || [ "${0##*/}" = "qvm-move" ] ; then
rm -rf -- "$@"
fi