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

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

vmm init [--stop]

    This command reads "vmmfile.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 "vmmfile.json".
    It the "--stop" flag is used, the virtual machine is stopped after
    initialization.

    Structure of "vmmfile.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)>,
      "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>",
          "<...>"
        ],
        ...
      }
    }

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

vmm run

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

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

vmm stop

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

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

vmm 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.

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

vmm 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.

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

vmm 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.

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

vmm 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 "vmm 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 "vmm run"). It is assumed that the VM is already created but stopped.

    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:
    >: vmm cmd -c calculator -i --rm
    This command will create virtual machine and
    run the command "echo '2+2' | bc" in it.

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

vmm status

    Help information about VM state.

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

vmm clean-cache

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

    If the environment variable "VMM_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/vmm/".

