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

C++ show_version函数代码示例

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

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



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

示例1: run

    int run(int argc, char *argv[])
    {
        po::positional_options_description p;
        p.add("input", -1);

        try {
            po::store(po::command_line_parser(argc,
                        argv).options(desc).positional(p).run(), vm);
            po::notify(vm);

            if (vm.count("manager"))
                *manager_mode = true;

            if (vm.count("input"))
                *args = vm["input"].as < CmdArgs >();

            if (vm.count("log-file"))
                *trace = 0;

            if (vm.count("log-stdout"))
                *trace = 1;

            if (vm.count("help"))
                return show_help(generic);

            if (vm.count("version"))
                return show_version();

            if (vm.count("infos"))
                return show_infos();

            if (vm.count("list"))
                return show_package_list();

            if (vm.count("restart"))
                return remove_configuration_file();

            if (vm.count("package"))
                return PROGRAM_OPTIONS_PACKAGE;

            if (vm.count("remote"))
                return PROGRAM_OPTIONS_REMOTE;

            if (vm.count("config"))
                return PROGRAM_OPTIONS_CONFIG;
        } catch (const std::exception &e) {
            std::cerr << e.what() << std::endl;

            return PROGRAM_OPTIONS_FAILURE;
        }

        std::cerr << _("Nothing to do. Use package, remote or config mode."
                " See the help.\n");

        return PROGRAM_OPTIONS_END;
    }
开发者ID:alsabadel,项目名称:vle,代码行数:56,代码来源:main.cpp


示例2: main

int main(int argc, char ** argv)
{
#ifdef ENABLE_GETTEXT
	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE_NAME, LOCALEDIR);
#endif

	static struct option longopts[] =
	{
		{ "version", no_argument, NULL, 'v' },
		{ "help", no_argument, NULL, 'h' },
		{ "input", required_argument, NULL, 'i' },
		{ "output", required_argument, NULL, 'o' },
		{ "config", required_argument, NULL, 'c' },
		{ 0, 0, 0, 0 },
	};

	static int oc;
	static char *input_file, *output_file, *config_file;

	while((oc = getopt_long(argc, argv, "vh?i:o:c:", longopts, NULL)) != -1)
	{
		switch (oc)
		{
		case 'v':
			show_version();
			return 0;
		case 'h':
		case '?':
			show_usage();
			return 0;
		case 'i':
			input_file = mstrcpy(optarg);
			break;
		case 'o':
			output_file = mstrcpy(optarg);
			break;
		case 'c':
			config_file = mstrcpy(optarg);
			break;
		}
	}

	if (config_file == NULL)
	{
		config_file = mstrcpy(OPENCC_DEFAULT_CONFIG_SIMP_TO_TRAD);
	}

	convert(input_file, output_file, config_file);

	free(input_file);
	free(output_file);
	free(config_file);

	return 0;
}
开发者ID:hruner,项目名称:OpenCC,代码行数:56,代码来源:opencc.c


示例3: get_options

static void get_options(int argc, char **argv, const char *progname)
{
	char c;

	while((c = getopt(argc, argv, "d:r:s:k:w:f:o:vh")) != (char) -1) {
		switch (c) {
		case 'r':
			repeat_filename = optarg;
			break;
		case 's':
			if(*optarg == 'd') {
				rectangle_size = -1;
				max_mem_kb = strtol(optarg + 1, 0, 10);
				if(max_mem_kb <= 0)
					max_mem_kb = ULONG_MAX;
			} else
				rectangle_size = atoi(optarg);
			if(rectangle_size == 0) {
				fprintf(stderr, "Invalid rectangle size %s\n", optarg);
				exit(1);
			}
			break;
		case 'k':
			kmer_size = atoi(optarg);
			break;
		case 'w':
			window_size = atoi(optarg);
			break;
		case 'o':
			output_filename = optarg;
			break;
		case 'd':
			debug_flags_set(optarg);
			break;
		case 'v':
			show_version(progname);
			exit(0);
		case 'h':
			show_help(progname);
			exit(0);
		}
	}

	if(argc - optind == 1) {
		sequence_filename = argv[optind++];
	} else if(argc - optind == 2) {
		sequence_filename = argv[optind++];
		second_sequence_filename = argv[optind++];
	} else {
		show_help(progname);
		fprintf(stderr, "Incorrect number of arguments. Expected 1 or 2, got %d\n", argc - optind);
		exit(1);
	}

}
开发者ID:rmcgibbo,项目名称:cctools-3.4.2-fork,代码行数:55,代码来源:sand_filter_kernel.c


示例4: konoha_shell

static kbool_t konoha_shell(konoha_t konoha)
{
	void *handler = dlopen("libreadline" K_OSDLLEXT, RTLD_LAZY);
	void *f = (handler != NULL) ? dlsym(handler, "readline") : NULL;
	kreadline = (f != NULL) ? (char* (*)(const char*))f : readline;
	f = (handler != NULL) ? dlsym(handler, "add_history") : NULL;
	kadd_history = (f != NULL) ? (int (*)(const char*))f : add_history;
	show_version((CTX_t)konoha);
	shell((CTX_t)konoha);
	return true;
}
开发者ID:OkamotoYuki,项目名称:konoha,代码行数:11,代码来源:command.c


示例5: show_usage

void
show_usage (char *my_name)
{
    show_version (my_name);
    fprintf (stderr, "\nusage: %s [options] port1 port2\n", my_name);
    fprintf (stderr, "Connects two JACK ports together.\n\n");
    fprintf (stderr, "        -s, --server <name>   Connect to the jack server named <name>\n");
    fprintf (stderr, "        -v, --version         Output version information and exit\n");
    fprintf (stderr, "        -h, --help            Display this help message\n\n");
    fprintf (stderr, "For more information see http://jackaudio.org/\n");
}
开发者ID:7890,项目名称:tools,代码行数:11,代码来源:connect.c


示例6: main

int main(int argc, char **argv)
{
        MalelfDissect dissect;
        MalelfInfect infect;
        Disas disas;
        Database database;
        Analyse analyse;
        _u8 error = MALELF_SUCCESS;

        if (argc == 1) {
                _malelf_help();
                return -1;
        }

        if (strncmp(argv[1], DISSECT, sizeof(DISSECT)) == 0) {
                error = malelf_dissect_init(&dissect, argc, argv);
                malelf_dissect_finish(&dissect);
        } else if (strncmp(argv[1],
                           SHELLCODE,
                           sizeof (SHELLCODE)) == 0) {
                malelf_shellcode_init(argc, argv);
                malelf_shellcode_finish();
        } else if (strncmp(argv[1], INFECT, sizeof(INFECT)) == 0) {
                malelf_infect_init(&infect, argc, argv);
                malelf_infect_finish(&infect);
        } else if (strncmp(argv[1], DYNAMIC_ANALYSIS, sizeof(DYNAMIC_ANALYSIS)) == 0) {
                malelf_dynanalyse_init(argc, argv);
                malelf_dynanalyse_finish();
        } else if (strncmp(argv[1], DISAS, sizeof(DISAS)) == 0) {
                disas_init(&disas, argc, argv);
                disas_finish(&disas);
        } else if (strncmp(argv[1], DATABASE, sizeof(DATABASE)) == 0) {
                database_init(&database, argc, argv);
                database_finish(&database);
        } else if (strncmp(argv[1], ANALYSE, sizeof(ANALYSE)) == 0) {
                error = analyse_init(&analyse, argc, argv);
                analyse_finish(&analyse);
        } else if (strncmp(argv[1], "-v", 2) ||
                   strncmp(argv[1], "--version", 9)) {
                show_version(*argv);
        } else {
                _malelf_help();
        }

        if (MALELF_SUCCESS != error) {
                if (MALELF_ERROR != error) {
                        MALELF_PERROR(error);
                }

                return error;
        }

        return 0;
}
开发者ID:ksmaheshkumar,项目名称:malelf,代码行数:54,代码来源:main.c


示例7: main

int
main(int nArgc, char* Argv[]){
	time_t	nStartTm, nEndTm;
	int	nRet;

	g_logFile = fopen("log.txt", "a");
	if ( g_logFile == NULL ){
		write_log(LT_SCREEN,"Error: Can't open log file!\n");
		goto exit;
	}

	nStartTm = time(NULL);
	if ( nArgc == 1 ){
		write_log(LT_SCREEN,"Error: the number of argument is error\n");
		goto exit;
	}
	else if ( nArgc == 2 ){
		if ( strcmp(Argv[1], "-h") == 0 ){
			show_help();
			return 0;
		}
		else if ( strcmp(Argv[1], "-v") == 0 ){
			show_version();
			return 0;
		}
		else {
			write_log(LT_SCREEN,"Error: invalid option '%s'\n", Argv[1]);			
			goto exit;
		}
	}
	
	if (Exec_Command(Argv) == 0)
		goto exit;
	
	nRet = 0;
	goto exit2;
 exit:
	nRet = 1;
	write_log(LT_SCREEN,"Please add '-h' option to get the detail help!\n");

 exit2:
	nEndTm = time(NULL);
	write_log(LT_BOTH,"\n--------------------------------------------------------\n");
	write_log(LT_BOTH,"Task end, total use time: %d min, %d sec\n",
	       (int)(nEndTm - nStartTm)/60, (int)(nEndTm - nStartTm)%60);

	db_uninit();
	str_operate_uninit();

	SAFE_CLOSE_FILE(g_logFile);

	return nRet;
}
开发者ID:pkxpp,项目名称:Study,代码行数:53,代码来源:main.cpp


示例8: main

int main(int argc, char **argv) {
  int fin, res;
  off_t position;

  int optc;
  int optindex=0;

  struct option optvalues[] = {
    {"help", 0, 0, 'h'},
    {"version", 0, 0, 'v'},
    {NULL, 0, NULL, 0}
  };

  if (argc < 2 || argc > 3) {
    usage("Missing or bad options/arguments");
    exit(-1);
  }

  while (1) {
    optc=getopt_long_only(argc,argv,"hv", optvalues, &optindex);
    if (optc=='h')
      usage(NULL);
    else if (optc=='v')
      show_version(VERSION);
    else if (optc==-1) break;
    else usage("Unknown option or other error\n");
  }

  if (optind >= argc) {
    usage("Missing filename argument.");
  }

  fin = open (argv[optind], O_RDONLY);
  if (fin < 0) {
    fprintf(stderr,"failed to open file %s for read\n", argv[optind]);
    exit(-1);
  }
  optind++;
  if (optind >= argc) {
    usage("Missing offset argument.");
  }
  position = atoll(argv[optind]);
  if (position <(off_t)0) {
    fprintf(stderr,"please specify an offset >= 0.\n");
    fprintf(stderr,"usage: %s infile offset\n", argv[0]);
    exit(-1);
  }
  /* input file, starting position in file, length of buffer for reading */
  res = dump_mw_header(fin);

  res = dump_from_first_page_id_after_offset(fin, position);
  exit(res);
}
开发者ID:wikimedia,项目名称:operations-dumps-mwbzutils,代码行数:53,代码来源:dumpbz2filefromoffset.c


示例9: show_help

static void show_help(void)
{
	show_version();
	fprintf(stderr,
		"-h --help      -  show this text and exit\n"
		"-v --version   -  show version and exit\n"
		"-r --reader    -  the reader to use\n"
		"-w --wait      -  wait for a card to be inserted\n"
		"-p --print     -  print the datafile\n"
		"-t --stats     -  show usage counts of keys\n"
		"-x --exec      -  execute a program with data in env vars.\n");
}
开发者ID:securez,项目名称:opendnie,代码行数:12,代码来源:eidenv.c


示例10: show_usage

void show_usage()
{
	show_version();
	printf(_("Usage:\n"));
	printf(_("  opencc_dict -i input_file -o output_file\n\n"));
	printf(_("    -i input_file\n"));
	printf(_("      Read data from input_file.\n"));
	printf(_("    -o output_file\n"));
	printf(_("      Write converted data to output_file.\n"));
	printf(_("\n"));
	printf(_("\n"));
}
开发者ID:tornadory,项目名称:OpenCC,代码行数:12,代码来源:opencc_dict.c


示例11: show_version_full

static void show_version_full (void)
{
    write_log ("\n");
    show_version ();
    write_log ("\nCopyright 1995-2002 Bernd Schmidt\n");
    write_log ("          1999-2005 Toni Wilen\n");
    write_log ("          2003-2005 Richard Drummond\n\n");
    write_log ("See the source for a full list of contributors.\n");

    write_log ("This is free software; see the file COPYING for copying conditions.  There is NO\n");
    write_log ("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
}
开发者ID:HoraceAndTheSpider,项目名称:PSPUAE,代码行数:12,代码来源:main.c


示例12: main

int main(int argc, char *argv[])
{
	int c, lpnumber;
	char *p;

	if (argc <= 0)		/* in case not provided in (x)inetd config */
		progname = "p910nd";
	else {
		progname = argv[0];
		if ((p = strrchr(progname, '/')) != 0)
			progname = p + 1;
	}
	lpnumber = '0';
	while ((c = getopt(argc, argv, "bi:f:v")) != EOF) {
		switch (c) {
		case 'b':
			bidir = 1;
			break;
		case 'f':
			device = optarg;
			break;
		case 'i':
			bindaddr = optarg;
			break;
		case 'v':
			show_version();
			break;
		default:
			usage();
			break;
		}
	}
	argc -= optind;
	argv += optind;
	if (argc > 0) {
		if (isdigit(argv[0][0]))
			lpnumber = argv[0][0];
	}
	/* change the n in argv[0] to match the port so ps will show that */
	if ((p = strstr(progname, "p910n")) != NULL)
		p[4] = lpnumber;

	/* We used to pass (LOG_PERROR|LOG_PID|LOG_LPR|LOG_ERR) to syslog, but
	 * syslog ignored the LOG_PID and LOG_PERROR option.  I.e. the intention
	 * was to add both options but the effect was to have neither.
	 * I disagree with the intention to add PERROR.  --Stef  */
	openlog(p, LOG_PID, LOG_LPR);
	if (is_standalone())
		server(lpnumber);
	else
		one_job(lpnumber);
	return (0);
}
开发者ID:StephenMacras,项目名称:dsl-n55u-bender,代码行数:53,代码来源:p910nd.c


示例13: show_help

static void
show_help (void)
{
	show_version ();
	
	printf ("-c --cpuusage		Display CPU usage.\n");
	printf ("-d --debug		Display debugging output.\n");
	printf ("-F --farenheit		Display temperature in farenheit.\n");
	printf ("-h --help		Display this help.\n");
	printf ("-i[FILE] --icon[=FILE]	Set the icon filename, or disable the icon.\n");
	printf ("-v --version		Display version information.\n");

	printf ("\nLong options may be passed with a single dash.\n\n");
}
开发者ID:bayi,项目名称:xfce-genmon-programs,代码行数:14,代码来源:cpuinfo.c


示例14: slave_get_options

void slave_get_options (int *argc,char ***argv, int *force, struct slave_database *sdb) {
    int opt;
    char *hour,*min;

    while ((opt = getopt (*argc,*argv,"a:n:fl:c:ohv")) != -1) {
        switch (opt) {
        case 'a':
            sdb->limits.autoenable.flags |= AEF_ACTIVE;
            hour = optarg;
            if ((min = strchr (hour,':')) == NULL) {
                usage ();
                exit (1);
            }
            *min = '\0';
            min++;
            sdb->limits.autoenable.h = atoi (hour) % 24;
            sdb->limits.autoenable.m = atoi (min) % 60;
            printf ("Autoenable time from command line: %02i:%02i\n",sdb->limits.autoenable.h,sdb->limits.autoenable.m);
            break;
        case 'n':
            sdb->limits.nmaxcpus = atoi (optarg);
            sdb->flags |= SDBF_SETMAXCPUS;
            break;
        case 'c':
            strncpy(sdb->conf,optarg,PATH_MAX-1);
            printf ("Reading config file from: '%s'\n",sdb->conf);
            break;
        case 'f':
            *force = 1;
            fprintf (stderr,"WARNING: Forcing usage of pre-existing shared memory (-f). Do not do this unless you really know what it means.\n");
            break;
        case 'l':
            log_level_severity_set (atoi(optarg));
            printf ("Logging level set to: %s\n",log_level_str(loglevel));
            break;
        case 'o':
            log_level_out_set (L_ONSCREEN);
            printf ("Logging on screen.\n");
            break;
        case 'v':
            show_version (*argv);
            exit (0);
        case '?':
        case 'h':
            usage();
            exit (0);
        }
    }
}
开发者ID:kubat,项目名称:drqueue,代码行数:49,代码来源:slave.c


示例15: main

int main(int argc, char *argv[]) 
{
#if defined(_WIN32) || defined(__CYGWIN__)
	const char * port = "COM1";
#else
	const char * port = "/dev/ttyS11";
#endif
	int fcnt;
	char * fnam[64];
	extern char *optarg;	/* getopt */
	extern int optind;	/* getopt */
	int c;

	/* the program name start just after the last slash */
	if ((progname = (char *)strrchr(argv[0], '/')) == NULL)
		progname = argv[0];
	else
		progname++;

	/* parse the command line options */
	while ((c = getopt(argc, argv, "dvhp:")) > 0) {
		switch (c) {
		case 'v':
			show_version();
			return 0;
		case 'h':
			show_usage();
			return 1;
		case 'p':
			port = optarg;
			break;
		default:
			parse_err(optarg);
			return 2;
		}
	}

	if (optind < argc) {
		fcnt = 0;
		do {
			fnam[fcnt++] = argv[optind];
			optind++;
		} while (optind < argc);

		return ymodem_send(port, fcnt, fnam); 
	}

	return ymodem_recv(port); 
}
开发者ID:k0059,项目名称:yard-ice,代码行数:49,代码来源:ymodem.c


示例16: show_usage

/*
 * Description: Displays the various available commands.
 */
static void show_usage ()
{
  int	   i ;

  show_version() ;

  printf( "Available Commands are:\n\n" ) ;

  for	( i = 0; i < tLength; i++ )
	{
	  printf( "\t%c  %-15s  %-30s\n", myCmdStruct[i].c
				  	, myCmdStruct[i].string
				  	, myCmdStruct[i].helptext ) ;
	}
}
开发者ID:wangp,项目名称:libcda,代码行数:18,代码来源:jvlexample.c


示例17: save_all

void
save_all(FILE *fp)
{
	show_version(fp);
	save_set_all(fp);
	save_functions__sub(fp);
	save_variables__sub(fp);
	fprintf(fp, "%s\n", replot_line);
	if (wri_to_fil_last_fit_cmd(NULL)) {
	    fputs("## ", fp);
	    wri_to_fil_last_fit_cmd(fp);
	    putc('\n', fp);
	}
	fputs("#    EOF\n", fp);
}
开发者ID:louri91,项目名称:ED201415,代码行数:15,代码来源:save.c


示例18: main

int main(int argc, char** argv) {
    
  
    
    static struct option long_options[] = {
        { "help", no_argument, NULL, 'h'},
        { "version", no_argument, NULL, 'r'},
        { NULL, 0, NULL, 0 }
    };
       

    int c, idx;
    while((c = getopt_long(argc, argv, "hr", long_options, &idx)) != -1) {
        switch(c) {
            case 'r':
                show_version(argc, argv);
                break;
            case 'h':
            case '?':
                show_usage(argc, argv);
                break;
            default:
                abort();
        }
    }



    FILE* fp = fdopen(fileno(stdout), "wb");
    if(!fp) {
        perror("stdout");
        return -1;
    }
    
    
    unsigned short zeros[NR_KEYS];
    memset(zeros, 0, sizeof(zeros));
        
    int i;
    for(i = 0; i < 16; i++) {
        if(key_maps[i])
            fwrite(key_maps[i], sizeof(unsigned short) * NR_KEYS, 1, fp);
        else
            fwrite(zeros, sizeof(unsigned short) * NR_KEYS, 1, fp);
    }
    
    return 0;
}
开发者ID:WareX97,项目名称:aPlus,代码行数:48,代码来源:kmgen.c


示例19: main

int main (int argc, char *argv[]) {
	bool help, version, output, input, decode;
	help = version = output = input = decode = false;
	char *input_file, *output_file;
	input_file = output_file = NULL;
	int flag = 0;
	struct option opts[] = {
		{"version", no_argument, 0, 'V'},
		{"help", no_argument, 0, 'h'},
		{"output", required_argument, 0, 'o'},
		{"input", required_argument, 0, 'i'},
		{"decode", no_argument, 0, 'd'}
	};

	while ((flag = getopt_long(argc, argv, "Vho:i:d", opts, NULL)) != -1) {
		switch (flag) {
			case 'V' :
				version = true;
				break;
			case 'h' :
				help = true;
				break;
			case 'o' :
				output_file = optarg;
				output = true;
				break;
			case 'i' :
				input_file = optarg;
				input = true;
				break;
			case 'd' :
				decode = true;
		}
	}

	if (help) {
		show_help();
	} else if (version) {
		show_version();
	} else if (input && output && decode) {
		decode_64_to_ascii(input_file, output_file);
	} else if (input && output) {
		encode_ascii_to_64(input_file, output_file);
	} else if (!feof(stdin)) {
		encode_ascii_to_64(NULL, NULL);
	}
	return EXIT_SUCCESS;
}
开发者ID:lucianoMintrone,项目名称:OrgaDeCompus-TP0,代码行数:48,代码来源:main.c


示例20: main

int main(int argc, char **argv)
{
    setlocale(LC_ALL, "" );
    textdomain("logistics");
    int c =0;
    while(( c = getopt_long(argc, argv, ":lhvi:r:uUgx", args, NULL)) != -1)
    {
        switch(c)
        {
	    	case 'h':
				show_help();
				return 0;
	    	break;
	    	case 'v':
				show_version();
				return 0;
	    	break;
            case 'l':
                list_all_packages_to_terminal();
            break;
            case 'i':
               	install_package(optarg);
            break;
            case 'r':
               	remove_package(optarg);
            break;
            case 'u':
               	update_package_db();
            break;
            case 'U':
               	system_upgrade();
            break;
            case 'g':
                gtk_init(&argc, &argv);
                init_gui(argc, argv, 0);
            break;
            case 'x':
                gtk_init(&argc, &argv);
                init_gui(argc, argv, 1);
            break;
			default:
				show_help();
				return 1;
			break;
        }
    }
    return 0;
}
开发者ID:jetspace,项目名称:logistics,代码行数:48,代码来源:main.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ show_window函数代码示例发布时间:2022-05-30
下一篇:
C++ show_usage函数代码示例发布时间: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