• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ showUsage函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中showUsage函数的典型用法代码示例。如果您正苦于以下问题:C++ showUsage函数的具体用法?C++ showUsage怎么用?C++ showUsage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了showUsage函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ledctrl_main

int ledctrl_main(int argc, char **argv)
{
    PLED_NAME_MAP namePtr = ledNameMap;
    PLED_STATE_MAP statePtr = ledStateMap;

    if (argc < 3)
        showUsage();

    while (namePtr->validLedName)
        if (strcmp(namePtr->validLedName, argv[1]) == 0)
            break;
        else
            namePtr++;
    if (!namePtr->validLedName)
        showUsage();

    while (statePtr->validLedState)
        if (strcmp(statePtr->validLedState, argv[2]) == 0)
            break;
        else
            statePtr++;

    if (!statePtr->validLedState)
        showUsage();

    sysLedCtrl(namePtr->ledName, statePtr->ledState);

	return 0;

}
开发者ID:dronixdevteam,项目名称:AGA-devel,代码行数:30,代码来源:ledctrl.c


示例2: main

/*------------------------------------------------------------------------------
 *  Program entry point
 *----------------------------------------------------------------------------*/
int
main (
    int     argc,
    char  * argv[] )
{
    int     res = -1;

    std::cout << "DarkIce " << VERSION
         << " live audio streamer, http://darkice.sourceforge.net"
         << std::endl
         << "Copyright (c) 2000-2004, Tyrell Hungary, http://tyrell.hu"
         << std::endl << std::endl;

    try {
        const char    * configFileName = 0;
        unsigned int    verbosity      = 1;
        int             i;
        const char      opts[] = "hc:v:";

        while ( (i = getopt( argc, argv, opts)) != -1 ) {
            switch ( i ) {
                case 'c':
                    configFileName = optarg;
                    break;

                case 'v':
                    verbosity = Util::strToL( optarg);
                    break;

                default:
                case ':':
                case '?':
                case 'h':
                    showUsage( std::cout);
                    return 1;
            }
        }

        if ( !configFileName ) {
            showUsage( std::cout);
            throw Exception( __FILE__, __LINE__,
                             "no configuration file specified");
        }

        std::cout << "Using config file: " << configFileName << std::endl;

        std::ifstream       configFile( configFileName);
        Config              config( configFile);
        Ref<DarkIce>        di = new DarkIce( config);
        di->setReportVerbosity( verbosity );
        di->setReportOutputStream( std::cout );

        res = di->run();

    } catch ( Exception   & e ) {
        std::cout << "DarkIce: " << e << std::endl << std::flush;
    }

    return res;
}
开发者ID:bryangrim,项目名称:darkice,代码行数:63,代码来源:main.cpp


示例3: n64_main

int n64_main(int argc, char* argv[]) {
	init();
	if (argc==1) {
		test();
		dumpCutoffs();
	}
	else if (!strcmp("generateFlipFunctions", argv[1])) {
		extern void generateFlipFunctions();
		generateFlipFunctions();
	}
	else if (!strcmp("generateSolverTestPositions", argv[1])) {
		if (argc < 3) {
			showUsage();
		}
		else {
			const int depth = atoi(argv[2]);
			generateSolverTestPositions(depth);
		}
	}
	else if (!strcmp("timeSolves", argv[1])) {
		if (argc < 3) {
			showUsage();
		}
		else {
			const int depth = atoi(argv[2]);
			timeSolves(1, depth, false);
		}
	}
	else if (!strcmp("timeWld", argv[1])) {
		if (argc < 3) {
			showUsage();
		}
		else {
			const int depth = atoi(argv[2]);
			timeSolves(1, depth, true);
		}
	}
	else if (!strcmp("stats", argv[1])) {
		if (argc < 3) {
			showUsage();
		}
		else {
			const int depth = atoi(argv[2]);
			timeSolves(1, depth, true);
		}
		dumpCutoffs();
	}
	else if (!strcmp("timeMobility", argv[1])) {
		extern void timeMobility();
		timeMobility();
	}
	else {
		showUsage();
	}

	return 0;
}
开发者ID:hongfei1988,项目名称:ntest,代码行数:57,代码来源:n64.cpp


示例4: main

int main(int argc, char** argv) {
	std::vector<Argument> arguments = createArguments();
	ArgumentParser argumentParser;
	try {
		argumentParser.parse(argc, argv, arguments);
	} catch(const GeneralException& exception) {
		std::cout << exception.what() << std::endl;
		showUsage(arguments);
		return -1;
	}
	if (argumentParser.isArgumentPresent('h')) {
		showUsage(arguments);
		return 0;
	}
	if (!areAllMandatoryArgumentsPresent(argumentParser)) {
		showUsage(arguments);
		return -1;
	}
	try {
		FractalParser parser;
		FractalParams params = parser.readFractal(argumentParser.getStringArgument('f'));
		Database* database;
		int hardwareConcurrency = std::thread::hardware_concurrency();
		if (hardwareConcurrency == 0) {
			hardwareConcurrency = 1;
		}
		int numberOfThreads = argumentParser.getIntArgumentOrReturnDefault('t', hardwareConcurrency);
		bool saveTemporaryResult = !argumentParser.isArgumentPresent('s');
		std::cout << "Number of threads: " << numberOfThreads << std::endl;
		if (argumentParser.isArgumentPresent('b')) {
			database = new Database();
		} else {
			database = new Database(argumentParser.getStringArgumentOrReturnDefault('d', "points.ff"));
		}
		ValueProvider* valueProvider = new ValueProvider(database, params, numberOfThreads);
		valueProvider->setIterationCountToConsiderInteresting(argumentParser.getIntArgumentOrReturnDefault('i', 100));
		if (argumentParser.isArgumentPresent('o')) {
			valueProvider->setReadOnlyFile(true);
		}
		if (argumentParser.isArgumentPresent('b')) {
			valueProvider->setNoDb(true);
		}
		for (double d = params.startPower; d <= params.endPower; d+= params.increment) {
			valueProvider->deleteSavedValues();
			Fractal fractal(valueProvider, params);
			fractal.draw(d, numberOfThreads, saveTemporaryResult);
		}
		delete database;
		delete valueProvider;
	} catch(const GeneralException& ex) {
		std::cout << "Exception occured: " << ex.what() << std::endl;
		return -1;
	}
	return 0;
}
开发者ID:helospark,项目名称:buddhabrot,代码行数:55,代码来源:main.cpp


示例5: main

int main(int argc, char** argv)
{
   bool daemon = true;
   char *ip = 0, *dest = 0;
   int opt, port = 0;
   while((opt = getopt(argc, argv, "hi:p:d:f")) != -1)
   {
      switch(opt)
      {
         case 'i':
            ip = strdup(optarg);
            break;
         case 'p':
            port = atoi(optarg);
            break;
         case 'd':
            dest = strdup(optarg);
            break;
         case 'h':
            showUsage();
            return 0;
            break;
         case 'f':
            daemon = false;
            break;
         case '?':
            showUsage();
            return 0;
            break;
      }
   }

   if((! port) || (! dest))
   {
      showUsage();
      return 1;
   }

   syslog(LOG_INFO, "Routing: %s:%d to: %s", (ip ? ip : "ALL"), port, dest);

   try
   {
      IpAddress ipAddr(ip, port);
      IpAddress destAddr(dest);
      SnmpRouted server(ipAddr, destAddr, daemon);
      syslog(LOG_INFO, "Started");
      server.run();
   }
   catch(NetErr& e)
   {
      syslog(LOG_ERR, "Exception %s", e.errm);
   }

   return 0;
}
开发者ID:jortel,项目名称:libs,代码行数:55,代码来源:snmpRouted.cpp


示例6: invalidArgs

bool invalidArgs(int argc, char *argv[]) {
    if (argc < 2 || argc > 3) {
        fprintf(stderr, "Erro! Quantidade invalida de argumentos.\n");
        showUsage();
        return true;
    }
    if (strcmp(argv[1], "-S") != 0 && strcmp(argv[1], "host") != 0) {
        fprintf(stderr, "Erro! Argumento invalido: %s\n", argv[1]);
        showUsage();
        return true;
    }
    return false;
}
开发者ID:gabrielnaves,项目名称:TD_Final_01_2016,代码行数:13,代码来源:main.c


示例7: parseArguments

static void parseArguments(int argc, char **argv)
{
  int i;

  programName = argv[0];

  /* Check for existence of at least the filename argument */

  if (argc < 2)
    {
      fprintf(stderr, "Invalid number of arguments\n");
      showUsage(); 
    }

  /* Parse any optional command line arguments */

  for (i = 1; i < argc-1; i++)
    {
      char *ptr = argv[i];
      if (ptr[0] == '-')
        {
          switch (ptr[1])
            {
            case 'I' :
              if (nIncPathes >= MAX_INCPATHES)
                {
                  fprintf(stderr, "Unrecognized [option]\n");
                  showUsage(); 
                }
              else
                {
                  includePath[nIncPathes] = &ptr[2];
                  nIncPathes++;
                }
              break;
            default:
              fprintf(stderr, "Unrecognized [option]\n");
              showUsage(); 
            }
        }
      else
        {
          fprintf(stderr, "Unrecognized [option]\n");
          showUsage(); 
        }
    }

  /* Extract the Pascal program name from the command line */

  sourceFileName = argv[argc-1];
}
开发者ID:0919061,项目名称:PX4NuttX,代码行数:51,代码来源:pas.c


示例8: parseCommandLine

/** \brief parse legacy nfd-status command line, and show usage if necessary
 *  \return if first item is -1, caller should retrieve and display StatusReport;
 *          otherwise, caller should immediately exit with the specified exit code
 */
static std::tuple<int, StatusReportOptions>
parseCommandLine(const std::vector<std::string>& args)
{
  StatusReportOptions options;

  namespace po = boost::program_options;
  po::options_description cmdOptions("StatusReportOptions");
  cmdOptions.add_options()
    ("help,h", "print this help message")
    ("version,V", "show program version")
    ("general,v", po::bool_switch(&options.wantForwarderGeneral), "show general status")
    ("channels,c", po::bool_switch(&options.wantChannels), "show channels")
    ("faces,f", po::bool_switch(&options.wantFaces), "show faces")
    ("fib,b", po::bool_switch(&options.wantFib), "show FIB entries")
    ("rib,r", po::bool_switch(&options.wantRib), "show RIB routes")
    ("sc,s", po::bool_switch(&options.wantStrategyChoice), "show strategy choice entries")
    ("xml,x", "output as XML instead of text (implies -vcfbrs)");
  po::variables_map vm;
  try {
    po::store(po::command_line_parser(args).options(cmdOptions).run(), vm);
    po::notify(vm);
  }
  catch (const po::error& e) {
    std::cerr << e.what() << "\n";
    showUsage(std::cerr, cmdOptions);
    return std::make_tuple(2, options);
  }

  if (vm.count("help") > 0) {
    showUsage(std::cout, cmdOptions);
    return std::make_tuple(0, options);
  }
  if (vm.count("version") > 0) {
    std::cout << "nfd-status " << NFD_VERSION_BUILD_STRING << "\n";
    return std::make_tuple(0, options);
  }

  if (vm.count("xml") > 0) {
    options.output = ReportFormat::XML;
  }
  if (options.output == ReportFormat::XML ||
      (!options.wantForwarderGeneral && !options.wantChannels && !options.wantFaces &&
       !options.wantFib && !options.wantRib && !options.wantStrategyChoice)) {
    options.wantForwarderGeneral = options.wantChannels = options.wantFaces =
      options.wantFib = options.wantRib = options.wantStrategyChoice = true;
  }

  return std::make_tuple(-1, options);
}
开发者ID:named-data-ndnSIM,项目名称:NFD,代码行数:53,代码来源:legacy-status.cpp


示例9: parseArguments

void parseArguments(const std::list<std::string>& args)
{
    std::list<std::string>::const_iterator i;

    // Set up defaults
    options.verbose = false;
    options.minTime = 1;
    options.bitsPerPixel = 16;
    options.listTests = false;

    for (i = args.begin(), i++; i != args.end(); ++i)
    {
        if (*i == "-h" || *i == "--help")
        {
            showUsage();
            exit(0);
        }
        else if (*i == "-i" && ++i != args.end())
        {
            options.includedTests.push_back(*i);
        }
        else if (*i == "-e" && ++i != args.end())
        {
            options.excludedTests.push_back(*i);
        }
        else if (*i == "-t" && ++i != args.end())
        {
            options.minTime = atoi((*i).c_str());
        }
        else if (*i == "-b" && ++i != args.end())
        {
            options.bitsPerPixel = atoi((*i).c_str());
        }
        else if (*i == "-v")
        {
            options.verbose = true;
        }
        else if (*i == "-l")
        {
            options.listTests = true;
        }
        else
        {
            std::cerr << "Invalid option: " << *i << std::endl;
            showUsage();
            exit(1);
        }
    }
}
开发者ID:akallabeth,项目名称:glmemperf,代码行数:49,代码来源:runner_cli.cpp


示例10: main

int main(int argc,char** argv)
{
    /*
    arg1 : ID
    */
    if(argc < 2)
    {
        showUsage();
        exit(0);
    }

    pairing_t pairing;
    element_t s,Sa,Qa;
    pairing_from_file(pairing,"globalParam/pairingParam");
    element_init_G1(Sa,pairing);
    element_init_G1(Qa,pairing);
    element_init_Zr(s,pairing);

    element_from_file(s,"masterKey/s");
    element_from_hash(Qa,argv[1],strlen(argv[1]));
    element_mul_zn(Sa,Qa,s);

    char loc[100] = "privateKey/";
    strcat(loc,argv[1]);
    strcat(loc,".priv");
    element_to_file(Sa,loc);

    return 0;
}
开发者ID:pigeon119,项目名称:LabProjects,代码行数:29,代码来源:extract.cpp


示例11: parseArguments

/*!
 * @brief コマンドライン引数の解析を行う
 *
 * 引数argvのうち、オプションに関係しないものは、後ろに並び替えられる。
 * その開始インデックスを返り値とする
 * @param [in]     argc      コマンドライン引数の数
 * @param [in,out] argv      コマンドライン引数
 * @param [out]    lang      音声合成の言語
 * @param [out]    filename  出力ファイル名
 * @return  残った引数のインデックス
 */
static int parseArguments(
    int          argc,
    char        *argv[],
    std::string &lang,
    std::string &filename)
{
  static const struct option opts[] = {
    {"help",     no_argument,       NULL, 'h'},
    {"language", required_argument, NULL, 'l'},
    {"output",   required_argument, NULL, 'o'},
    {0, 0, 0, 0}   // must be filled with zero
  };

  int ret;
  int optidx;
  while ((ret = getopt_long(argc, argv, "hl:o:", opts, &optidx)) != -1) {
    switch (ret) {
      case 'h':  // -h or --help
        showUsage(argv[0], EXIT_SUCCESS);
        break;
      case 'l':  // -l or --language
        lang = optarg;
        break;
      case 'o':  // -o or --output
        filename = optarg;
        break;
    }
  }
  return optind;
}
开发者ID:koturn,项目名称:sayss,代码行数:41,代码来源:sayss.cpp


示例12: parse_arg

void parse_arg( int argc, char * argv[] )
{
	extern char *optarg ;
	int c ;

	while( ( c = getopt ( argc, argv, "h:p:c:m:w:s:v" )) != EOF ) {
		switch ( c ) {
			case 'h' :
				gHost = optarg;
				break;
			case 'p':
				gPort = atoi( optarg );
				break;
			case 'c' :
				gClients = atoi ( optarg );
				break;
			case 'm' :
				gMsgs = atoi( optarg );
				break;
			case 'w':
				gConnWait = atoi( optarg );
				break;
			case 's':
				gSockWait = atoi( optarg );
				break;
			case 'v' :
			case '?' :
				showUsage( argv[0] );
				exit( 0 );
		}
	}
}
开发者ID:CCoder123,项目名称:pproj,代码行数:32,代码来源:teststress.cpp


示例13: main

int main(int argc, char **argv) {
	if (argc != 3) {
		showUsage();
		return 1;
	}

	int securityLevel = atoi(argv[1]);
	string rngSeed(argv[2]);
	size_t rngSeedLength = 16;

	string fullLine;
	string line;
	while (getline(cin, line)) {
		fullLine.append(line);
	}
	byte *inputData = (byte *) fullLine.data();
	int inputLength = fullLine.length();

	RegisterFactories();
	rngSeed.resize(rngSeedLength);
	s_globalRNG.SetKeyWithIV((byte *)rngSeed.data(), rngSeedLength, (byte *)rngSeed.data());

	int securityIndex = 0;
	for (int i = 0; i < NUMBER_OF_SECURITY_LENGTHS; i++) {
		if (securityLevels[i] == securityLevel) {
			securityIndex = i;
			break;
		}
	}
	
	ProfileSignatureSchemes(inputData, inputLength, securityIndex);
}
开发者ID:chris-wood,项目名称:SignatureVerification,代码行数:32,代码来源:verifier.cpp


示例14: useCommandLine

// Return the image specified on the command line.
//
static cv::Mat useCommandLine(int ac, const char *av[])
{
    cv::Mat result;
    if (ac == 2) result = cv::imread(av[1]);
    if (!result.data) showUsage(av[0]);
    return result;
}
开发者ID:tbl3rd,项目名称:opencv-tutorials,代码行数:9,代码来源:brightContrast.cpp


示例15: cmdargParse

void
cmdargParse(const char **argv)
{
    argv0 = argv[0];
    for (argv++; *argv != NULL; argv++) {
	if ((*argv)[0] == '-') {
	    switch ((*argv)[1]) {
	    case 'c': /* -c <commx args>*/
		cmdarg.ttymode = CA_COMMX;
		cmdarg.commx = *++argv;
		if (cmdarg.commx == NULL) goto FEWARG;
		break;
	    case 'd': /* -d <pty_device>*/
		cmdarg.ttymode = CA_DEVGIVEN;
		cmdarg.dev = *++argv;
		if (cmdarg.dev == NULL) goto FEWARG;
		break;
	    case 'e': /* -e <atcommands>*/
		cmdarg.atcmd = *++argv;
		if (cmdarg.atcmd == NULL) goto FEWARG;
		break;
	    case 'h': /* -h */
		showUsage();
		exit(0);
	    case 's': /* -s */
		cmdarg.ttymode = CA_SHOWDEV;
		break;
	    case '\0': /* - */
		cmdarg.ttymode = CA_STDINOUT;
		break;
	    default:
		fprintf(stderr, "Unknown option -%c.\n", (*argv)[1]);
		showUsage();
		exit(1);
	    }
	} else {
	    fprintf(stderr, "Error in command line.\n");
	    showUsage();
	    exit(1);
	}
    }
    return;

 FEWARG:
    fprintf(stderr, "'-%c' requires an argument.\n", (*--argv)[1]);
    exit(1);
}
开发者ID:andrewbird,项目名称:dosemu2,代码行数:47,代码来源:cmdarg.c


示例16: showUsage

bool Display::parseCommandLine()
{
  parseError = false;
  if (argc_ < 2)
  {
    parseError = true;
    //showUsage();
    return false;
  }
  if (argv_[1][0] == '/')
  {
    showUsage();
    return 1;
  }
  path_ = argv_[1];
  if (!FileSystem::Directory::exists(path_))
  {
    std::cout << "\n  can't find directory \"" << path_ << "\"";
    parseError = true;
    return false;
  }
  // find options and patterns,
  // ignore unrecognized options, accept all patterns

  optionState_[s] = false;
  optionState_[a] = false;
  optionState_[d] = false;
  optionState_[f] = false;
  optionState_[q] = false;
  optionState_[c] = false;

  for (int i = 2; i < argc_; ++i)
  {
    if (argv_[i][0] == '/')
    {
      switch (argv_[i][1])
      {
      case 's': optionState_[s] = true; break;
      case 'a': optionState_[a] = true; break;
      case 'd': optionState_[d] = true; break;
      case 'f':
        optionState_[f] = true;
        searchText_ = std::string(argv_[i]).substr(2);
        break;
      case 'q': optionState_[q] = true; break;
      case 'c': optionState_[c] = true; break;
      case 'h': optionState_[h] = true; break;
      case '?': optionState_[h] = true; break;
      default: break;
      }
    }
    else
    {
      patterns_.push_back(argv_[i]);
      cat_.addPattern(argv_[i]);
    }
  }
  return true;
}
开发者ID:saurabhkpatel,项目名称:academic_projects,代码行数:59,代码来源:Display.cpp


示例17: main

int main( int argc, char ** argv )
{
    //Check for root permissions
    if( getuid() == 0){
      qDebug() << "pc-webkitviewer must not be started as root!";
      return 1;
    }
    qDebug() << "Starting up the generic webkitviewer";
    QApplication a(argc, argv);   

    QTranslator translator;
    QLocale mylocale;
    QString langCode = mylocale.name();
    if ( ! QFile::exists( PREFIX + "/share/pcbsd/i18n/webkitviewer_" + langCode + ".qm" ) )
      langCode.truncate(langCode.indexOf("_"));
    translator.load( QString("webkitviewer_") + langCode, PREFIX + "/share/pcbsd/i18n/" );
    a.installTranslator( &translator );
    qDebug() << "Locale:" << langCode;
    QTextCodec::setCodecForLocale( QTextCodec::codecForName("UTF-8") ); //Force Utf-8 compliance
    
    bool debug = false;
    QString fileURL, title, iconpath;
    //Load the inputs
      for(int i=1; i<argc; i++){
	QString arg = QString(argv[i]);
        if(!debug){ 
	  debug = ( arg=="--debug"); 
	  if(debug){ continue; }
        }
	if(arg=="--titletext" || arg=="-t"){
	  if(i+1<argc){ i++; title = QString(argv[i]); }
	  continue;
	}
	if(arg=="--icon" || arg=="-i"){
	  if(i+1<argc){ i++; iconpath = QString(argv[i]); }
	  continue;
	}
        fileURL = QString(arg);
      }
    if(fileURL.isEmpty()){ qDebug() << "No File/URL supplied!"; showUsage(); return 1; }
    else{  
      //Add a check for relative file paths
      if(!fileURL.contains("://") && !fileURL.startsWith("/")){
        if(QFile::exists(QDir::currentPath()+"/"+fileURL)){
	  //Save and use the full path instead
	  fileURL = QDir::currentPath()+"/"+fileURL;
	}
      }
    }
      //Launch the UI
      qDebug() << "Opening:" << fileURL;
      //qDebug() << " - Inputs:" << debug << title << iconpath;
      MainUI w(debug, fileURL, title, iconpath); 
      w.show();

      a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
      return a.exec();

}
开发者ID:claudiobsd,项目名称:pcbsd,代码行数:59,代码来源:main.cpp


示例18: main

int main(int argc, char* argv[]) {
    char* fileName;
    int errLevel;
    gridCell_t** dungeonGrid;
    room_t* rooms;
    int roomCount;
    // parse arguments
    int save = 0;
    int load = 0;
    for (int i = 0; i < argc; i++) {
        if (strcmp(argv[1], "--save") == 0) {
            save = 1;
        } else if (strcmp(argv[1], "--load") == 0) {
            load = 1;
        } else {
            showUsage(argv[0]);
            return 0;
        }
    }

    // load or generate dungeon
    if (load) {
        fileName = dungeonFileName();
        errLevel = loadDungeon(&dungeonGrid, &roomCount, &rooms, fileName);
        free(fileName);
        if (errLevel) {
            printf("Failed to load the dungeon.  Read error %d\n", errLevel);
            return -1;
        }
        populateRooms(dungeonGrid, rooms, roomCount);
    } else {
        roomCount = generateDungeon(&dungeonGrid, &rooms);
        if (roomCount < 0) {
            printf("Failed to allocate memory for the dungeon grid.\n");
            return roomCount;
        }
    }

    // print dungeon
    printRooms(roomCount, rooms);
    printGrid(dungeonGrid);

    // save dungeon
    if (save) {
        fileName = dungeonFileName();
        errLevel = saveDungeon(dungeonGrid, roomCount, rooms, fileName);
        free(fileName);
        if (errLevel) {
            printf("Failed to save the dungeon.  Save error %d\n", errLevel);
            return -1;
        }
    }

    // Clean up
    free2DGrid(dungeonGrid, HEIGHT);
    free(rooms);
    return 0;
}
开发者ID:joel0,项目名称:CS327-Spring2016,代码行数:58,代码来源:main.c


示例19: main

int main(int argc, char ** argv)
{
    int config_status = loadConfig(argc, argv, USAGE_CLIENT); 
    if (config_status < 0) {
        if (config_status == CONFIG_VERSION) {
            reportVersion(argv[0]);
            return 0;
        } else if (config_status == CONFIG_HELP) {
            showUsage(argv[0], USAGE_CLIENT, "[ [package.]function]");
            return 0;
        } else if (config_status != CONFIG_ERROR) {
            log(ERROR, "Unknown error reading configuration.");
        }
        // Fatal error loading config file
        return 1;
    }

    int optind = config_status;

    assert(optind <= argc);

    if (optind == (argc - 1)) {
        std::string arg(argv[optind]);
        std::string::size_type pos = arg.rfind(".");
        if (pos == std::string::npos) {
            // std::cout << "function " << arg << std::endl << std::flush;
            function = arg;
        } else {
            package = arg.substr(0, pos);
            function = arg.substr(pos + 1);
            // std::cout << "module.function " << package << "." << function << std::endl << std::flush;
        }
    } else if (optind != argc) {
        usage(argv[0]);
        return 1;
    }

    bool interactive = global_conf->findItem("", "interactive");
    int status = 0;

    init_python_api(ruleset_name, false);
    extend_client_python_api();
    new ClientPropertyManager();

    if (interactive) {
        python_prompt();
    } else {
        std::map<std::string, std::string> keywords;
        keywords["account"] = account;
        keywords["password"] = password;
        keywords["host"] = server;
        python_client_script(package, function, keywords);
    }

    shutdown_python_api();

    return status;
}
开发者ID:olekw,项目名称:cyphesis,代码行数:58,代码来源:client.cpp


示例20: main

int main(int argc, char *argv[]) {
    if (argc != 2) {
        showUsage(argc, argv, "tree directory");
        return;
    }

    myTree(argv[1], 0);
    
}
开发者ID:cclehui,项目名称:study,代码行数:9,代码来源:tree.c



注:本文中的showUsage函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ showVersion函数代码示例发布时间:2022-05-30
下一篇:
C++ showTime函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap