}
// get command
- try
+ if (optind < _argc)
{
- if (optind < _argc)
- setCommand(ZypperCommand(_argv[optind++]));
- }
- // exception from command parsing
- catch (Exception & e)
- {
- cerr << e.asUserString() << endl;
- setCommand(ZypperCommand::NONE);
+ try { setCommand(ZypperCommand(_argv[optind++])); }
+ // exception from command parsing
+ catch (Exception & e)
+ {
+ cerr << e.asUserString() << endl;
+ //setCommand(ZypperCommand::NONE);
+ }
}
+ else
+ setRunningHelp();
if (command() == ZypperCommand::HELP)
{
}
else if (command() == ZypperCommand::NONE)
{
- if (gopts.count("version"))
+ if (runningHelp())
+ print_main_help();
+ else if (gopts.count("version"))
cout << PACKAGE " " VERSION << endl;
else
{
try
{
processCommandOptions();
- if (exiting())
+ if (exiting() || command() == ZypperCommand::NONE)
return;
doCommand();
}
+- zypper
- zypper help
+- zypper -h
show list of global options and list of commands
- zypper help help
in shell
+- empty line entered
+ show unknown command hint
+
- help
show list of global options and list of commands