main: switch command parsing to use clap

Partially revert 111225a2a5
and add the new dbus and pvpanic arguments.

As we are switching back to clap observe the following changes.

A few examples:

1. `-v -v -v` needs to be written as`-vvv`
2. `--disk D1 --disk D2` and others need to be written as `--disk D1 D2`.
3. `--option value` needs to be written as `--option=value.`

Change integration tests to adapt to the breaking changes.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@intel.com>
This commit is contained in:
Wei Liu
2023-07-08 01:38:51 +00:00
committed by Bo Chen
parent 6113483363
commit 7bc3452139
10 changed files with 807 additions and 469 deletions

View File

@@ -1152,7 +1152,7 @@ impl ToString for VerbosityLevel {
match self {
Warn => "".to_string(),
Info => "-v".to_string(),
Debug => "-v -v".to_string(),
Debug => "-vv".to_string(),
}
}
}
@@ -1203,7 +1203,7 @@ impl<'a> GuestCommand<'a> {
self.command.arg("-v");
}
Debug => {
self.command.args(["-v", "-v"]);
self.command.args(["-vv"]);
}
};
@@ -1271,7 +1271,6 @@ impl<'a> GuestCommand<'a> {
.unwrap()
)
.as_str(),
"--disk",
format!(
"path={}",
self.guest.disk_config.disk(DiskType::CloudInit).unwrap()