Skip to content

Commit

Permalink
Add proper help text to qvm-copy tools and fix incorrect behavior
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marmarta committed Jul 15, 2018
1 parent f4c10d4 commit 989ef1f
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions qubes-rpc/qvm-copy-to-vm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit 989ef1f

Please sign in to comment.