|
@@ -20,10 +20,11 @@ void show_help(char *exec) {
|
|
|
int main(int argc, char **argv) {
|
|
|
bpo::options_description desc("Options");
|
|
|
desc.add_options()("help", "show this help")("machine", "switch to machine mode for I/O (not designed for user interaction)")(
|
|
|
- "batch", bpo::value<std::string>(), "run operations from arg as batch file")("usessl", "enable ssl for connection to server");
|
|
|
+ "batch", bpo::value<std::string>(), "run operations from arg as batch file")("usessl", "enable ssl for connection to server")("verbose",
|
|
|
+ "enable debug output");
|
|
|
|
|
|
bpo::variables_map vm;
|
|
|
- bool machine = false, usessl = false, batch = false;
|
|
|
+ bool machine = false, usessl = false, batch = false, verbose = false;
|
|
|
const char *file = NULL;
|
|
|
IoMan *ioman;
|
|
|
|
|
@@ -54,16 +55,19 @@ int main(int argc, char **argv) {
|
|
|
if (vm.count("usessl")) {
|
|
|
usessl = true;
|
|
|
}
|
|
|
+ if (vm.count("verbose")) {
|
|
|
+ verbose = true;
|
|
|
+ }
|
|
|
} catch (const bpo::error &ex) {
|
|
|
std::fprintf(stderr, "%s\n", ex.what());
|
|
|
}
|
|
|
- std::printf("ip %s machine mode is %d file is %s enablessl is %d\n", argv[1], machine, file ? file : "", usessl);
|
|
|
+ std::printf("ip %s machine mode is %d file is %s enablessl is %d verbose is %d\n", argv[1], machine, file ? file : "", usessl, verbose);
|
|
|
if (batch) {
|
|
|
- ioman = new BatchIoMan(argv[1], usessl, file);
|
|
|
+ ioman = new BatchIoMan(argv[1], usessl, verbose, file);
|
|
|
} else if (machine) {
|
|
|
- ioman = new MachineIoMan(argv[1], usessl);
|
|
|
+ ioman = new MachineIoMan(argv[1], usessl, verbose);
|
|
|
} else {
|
|
|
- ioman = new UserIoMan(argv[1], usessl);
|
|
|
+ ioman = new UserIoMan(argv[1], usessl, verbose);
|
|
|
}
|
|
|
gIOMAN = ioman;
|
|
|
if (ioman->init()) {
|