示例#1
0
bool ZorbaCMDProperties::loadProperties(int argc, char* argv[]) 
{
  std::string result = load_argv(argc, (const char **) argv);

  if (result.empty())
    result = check_args();

  if (result == "!HELP") 
  {
    std::cout << "Zorba XQuery Engine, Version: " 
              << zorba::Zorba::version() << std::endl;
    std::cout << "Available options:\n\n";
    std::cout << get_help_msg ();
    return false;
  }
  else if (result == "!VER") 
  {
    std::cout << "Zorba XQuery Engine, Version: " 
              << zorba::Zorba::version() << std::endl;
    return false;
  }
  else if (result.empty ())
  {
    return true;
  }
  else if (result [0] != '!')
  {
    std::cout << "Error: " << result << std::endl;
    return false;
  }
  else
  {
    return false;
  }  
}
示例#2
0
文件: cmdmisc.c 项目: ak-ymst/mruby
static mrb_bool
show_long_help(char *cmd1, char *cmd2)
{
  help_msg *help;

  if ((help = get_help_msg(cmd1, cmd2)) == NULL) {
    return FALSE;
  }
  printf("%s", help->long_msg);
  return TRUE;
}