Usage:
    qmm init          # Create and prepare VM.
    qmm run           # Run created VM.
    qmm connect       # Interactive work with VM.
    qmm stop          # Stop running VM.
    qmm eliminate     # Stop and remove VM.
    qmm upload        # Copy files to VM.
    qmm take          # Copy files from VM.
    qmm cmd           # Run named command from configuration.
    qmm status        # Show information about VM.
    qmm clean-cache   # Remove downloaded virtual disks.
    qmm --help|-h     # Show this help.
    qmm --version|-v  # Show current version.

================================================================================

qmm init [--stop]

    This command reads "qmmfile.json" in the current working directory and
    creates a new virtual machine according parameters from this file.
    Once the virtual machine is created and started, the commands listed
    in the "init_commands" field from "qmmfile.json".
    It the "--stop" flag is used, the virtual machine is stopped after
    initialization.

    Structure of "qmmfile.json":

    {
      "base": "<path or url to base disk image>",
      "vm_disk": "<path to store new virtual disk for new VM>",
      "name": "<VM name>",
      "os": "<OS name, see: virt-install --osinfo list>",
      "cpus": <number of CPU kernels for VM>,
      "memory": <RAM size (MiB)>,
      "interpreter": "<interpreter>",
      "init_commands": [
        "<first command to execute...>",
        "<second command to execute...>",
        "<...>"
      ],
      "commands": {
        "<named_command_1>": [
          "<first action>",
          "<second action>",
          "<...>"
        ],
        "<named_command_2>": [
          "<first action>",
          "<second action>",
          "<...>"
        ],
        ...
      }
    }

================================================================================

qmm run

    This command reads the "name" field from "qmmfile.json" and
    starts the correspond virtual machine.

================================================================================

qmm connect

    Using this command, you connect via SSH to the running virtual machine.

================================================================================

qmm stop

    This command reads the "name" field from "qmmfile.json" and
    stops the correspond virtual machine.

================================================================================

qmm eliminate [--rm-disk]

    This command stops the virtual machine (if running) and deletes it.
    If the "--rm-disk" flag is used, the related virtual disk is removed.

================================================================================

qmm upload --from <source> --to <destination>

    This command copies files from the host machine to the virtual machine.
    The source/destination can be either a regular file or a directory.

================================================================================

qmm take --from <source> --to <destination>

    This command copies files from the virtual machine to the host machine.
    The source/destination can be either a regular file or a directory.

================================================================================

qmm cmd -c <named_command> [-i|--init] [-r|--run] [-u] [--rm]

    This command is needed to execute named sequences of commands from the
    configuration file (the "commands" field).

    If the "-i" (or "--init") flag is used, the VM will be pre-initialized
    (as with "qmm init").

    The "--rm" flag is needed if you want to delete the VM along
    with the virtual disk immediately after executing the command.

    If the "-r" (or "--run") flag is used, the VM will be started (as
    with "qmm run"). It is assumed that the VM is already created but stopped.

    When the "-u" flag is used,
    the current directory is copied to the VM (to /qmm).

    Sometimes a VM is created to accomplish one task,
    after which the machine is no longer needed.
    If the "--rm" flag is used, the VM is destroyed.

    Example of commands from configuration:

        "commands": {
            "probe": [
                "cat /etc/os-release",
                "echo It's working!",
            ],
            "calculator": [
                "echo '2+2' | bc"
            ]
        }

    You can run the "calculator" target:
    >: qmm cmd -c calculator -i --rm
    This command will create virtual machine and
    run the command "echo '2+2' | bc" in it.

qmm cmd -s <command> [-i|--init] [-r|--run] [-u] [--rm]

    The meaning is the same, but instead of a named command from
    configuration, but a shell command to execute is specified.

    Example:
    >: qmm cmd -s "cd /qmm/my-project; make" -i -u

================================================================================

qmm status

    Help information about VM state.

================================================================================

qmm clean-cache

    The contents of the directory for the downloaded virtual disks are cleared.

    If the environment variable "QMM_CACHE_DIR" exists, the path to the storage
    location of the downloaded virtual disks is defined by this variable.
    Otherwise, the path is defined as "~/.cache/qmm/".

