本文整理汇总了C++中showVersion函数的典型用法代码示例。如果您正苦于以下问题:C++ showVersion函数的具体用法?C++ showVersion怎么用?C++ showVersion使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showVersion函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main (int argc, char* const argv[])
{
init();
if (argc == 1 && usage())
return 0;
if (parseCmdLine(argc, argv) != 0)
return 0;
if (optShowHelp && showHelp())
return 0;
if (optShowVersion && showVersion())
return 0;
curl_global_init(CURL_GLOBAL_ALL);
for (int i = 0; i < optFiles.size(); i++)
{
std::string processed = processImage(optFiles[i], optImageSize);
if (processed == "")
continue;
if (processed != optFiles[i])
tempFiles.push_back(processed);
std::string err;
std::string output = uploadImage(processed.c_str(), err);
if (!userOutput(output) || err.length() > 0)
fprintf(stderr, "Upload failed for %s.\n%s\n", optFiles[i].c_str(), err.c_str());
}
for (int i = 0; i < tempFiles.size(); i++)
remove(tempFiles[i].c_str());
return 0;
}
示例2: main
int main(int argc, char *argv[])
{
char const * dir;
int root_fd;
int this_fd;
char * umount_cmd[] = { UMOUNT_PROG, "-l", "-n", ".", 0 };
if (argc<2) {
WRITE_MSG(2, "Try '");
WRITE_STR(2, argv[0]);
WRITE_MSG(2, " --help' for more information.\n");
return EXIT_FAILURE;
}
if (strcmp(argv[1], "--help")==0) showHelp(1, argv[0], 0);
if (strcmp(argv[1], "--version")==0) showVersion();
dir = argv[1];
if (strcmp(dir, "--")==0 && argc>=3) dir = argv[2];
root_fd = Eopen("/", O_RDONLY, 0);
Echroot(".");
Echdir(dir);
this_fd = Eopen(".", O_RDONLY, 0);
Efchdir(root_fd);
Echroot(".");
Efchdir(this_fd);
Eclose(root_fd);
Eclose(this_fd);
Eexecv(umount_cmd[0], umount_cmd);
}
示例3: showHelp
static void showHelp() {
std::cerr << "Usage moc: [options] <header-file>\n"
" -o<file> write output to file rather than stdout\n"
" -I<dir> add dir to the include path for header files\n"
" -E preprocess only; do not generate meta object code\n"
" -D<macro>[=<def>] define macro, with optional definition\n"
" -U<macro> undefine macro\n"
" -M<key=valye> add key/value pair to plugin meta data\n"
" -i do not generate an #include statement\n"
// " -p<path> path prefix for included file\n"
// " -f[<file>] force #include, optional file name\n"
// " -nn do not display notes\n"
// " -nw do not display warnings\n"
// " @<file> read additional options from file\n"
" -v display version of moc-ng\n"
/* undocumented options
" -include <file> Adds an implicit #include into the predefines buffer which is read before the source file is preprocessed\n"
" -W<warnings> Enable the specified warning\n"
" -f<option> clang option\n"
" -X<ext> <arg> extensions arguments\n"
*/
<< std::endl;
showVersion(false);
}
示例4: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setOrganizationDomain(QLatin1String("mapeditor.org"));
a.setApplicationName(QLatin1String("TmxRasterizer"));
a.setApplicationVersion(QLatin1String("1.0"));
CommandLineOptions options;
parseCommandLineArguments(options);
if (options.showVersion) {
showVersion();
return 0;
}
if (options.showHelp || options.fileToOpen.isEmpty() || options.fileToSave.isEmpty()) {
showHelp();
return 0;
}
if (options.scale <= 0.0 && options.tileSize <= 0) {
showHelp();
return 0;
}
TmxRasterizer w;
w.setAntiAliasing(options.useAntiAliasing);
if (options.tileSize > 0) {
w.setTileSize(options.tileSize);
} else if (options.scale > 0.0) {
w.setScale(options.scale);
}
return w.render(options.fileToOpen, options.fileToSave);
}
示例5: showVersion
void Options::showUsage(std::ostream& stream) const
{
showVersion(stream);
stream << "\nUsage:\n"
<< " " << program_name_ << " [options]\n\n"
<< desc_
<< "\nExamples:\n"
<< " Generate waveform data from an MP3 file, at 256 samples per point\n"
<< " with 8-bit resolution:\n"
<< " " << program_name_ << " -i test.mp3 -o test.dat -z 256 -b 8\n\n"
<< " Generate a 1000x200 pixel PNG image from a waveform data file\n"
<< " at 512 samples per pixel, starting at 5.0 seconds:\n"
<< " " << program_name_ << " -i test.dat -o test.png -z 512 -s 5.0 -w 1000 -h 200\n\n"
<< " Generate a 1000x2000 pixel PNG image from a waveform data file\n"
<< " starting at 5.0 seconds, ending at 10.0 seconds:\n"
<< " " << program_name_ << " -i test.dat -o test.png -s 5.0 -e 10.0 -w 1000 -h 200\n\n"
<< " Convert a waveform data file to JSON format:\n"
<< " " << program_name_ << " -i test.dat -o test.json\n\n"
<< " Convert MP3 to WAV format audio:\n"
<< " " << program_name_ << " -i test.mp3 -o test.wav\n";
}
示例6: usage
/* usage() - print usage information */
void usage(char *procname, boolean full)
{
if (full)
{
showVersion(procname);
printf("\nUsage:\n ");
}
printf("%s [options] -f file.yml [dbname [username]]\n", procname);
if (full)
{
printf(
"\n"
"General options:\n"
" -? | --help show this help, then exit\n"
" -V | --version show version information, then exit\n"
" -v | --verbose verbose output\n"
" -x | --explain do not run jobs, but produce explain plans\n"
" -X | --explain-analyze run jobs and produce explain-analyze plans\n"
" -k | --key <name>=<value> sets a yaml variable\n"
"\n"
"Connection options:\n"
" -h | --host <hostname> database server host or socket directory\n"
" -p | --port <port> database server port\n"
" -U | --username <username> database user name\n"
" -W | --password prompt for password\n"
);
}
}
示例7: main
int main(int argc, char *argv[])
{
// Avoid performance issues with X11 engine when rendering objects
#ifdef Q_WS_X11
QApplication::setGraphicsSystem(QLatin1String("raster"));
#endif
QApplication a(argc, argv);
a.setOrganizationDomain(QLatin1String("mapeditor.org"));
a.setApplicationName(QLatin1String("TmxViewer"));
a.setApplicationVersion(QLatin1String("1.0"));
CommandLineOptions options;
parseCommandLineArguments(options);
if (options.showVersion)
showVersion();
if (options.showHelp || (options.fileToOpen.isEmpty()
&& !options.showVersion))
showHelp();
if (options.showVersion
|| options.showHelp
|| options.fileToOpen.isEmpty())
return 0;
TmxViewer w;
w.viewMap(options.fileToOpen);
w.show();
return a.exec();
}
示例8: main
int
main(int argc,char *argv[])
{
int opt;
prefix[0] = 0;
target_ip = 0;
debug = verbose = 0;
while((opt=getopt(argc,argv,"dD:iI:t:vV")) != EOF) {
switch(opt) {
case 'D':
sprintf(prefix,"%s",optarg);
break;
case 'i':
strcpy(prefix,"${IPADD}");
break;
case 'I':
sprintf(prefix,"%s/${IPADD}",optarg);
break;
case 't':
target_ip = optarg;
ttftp_init();
tftpQuiet = 1;
break;
case 'V':
showVersion();
break;
case 'v':
verbose = 1;
break;
default:
usage(0);
}
}
if (target_ip)
mkflist_fromtftp(target_ip);
else
mkflist_fromcli(argc,argv);
if (!fbase) {
fprintf(stderr,"Failed to generate file list\n");
exit(1);
}
if (debug) {
flist = fbase;
while(flist) {
printf("Name: <%s> flgs: <%s> info: <%s>\n",
flist->tfs_fname,flist->flags,flist->info);
flist = flist->next;
}
}
mkupdate();
exit(0);
}
示例9: parse_args
static void parse_args(int ac, char **av)
{
int verbose = 1;
int i;
if (ac == 1)
return;
for (i = 1; i < ac; i++)
if (strcmp(av[i], "-c") == 0)
i++;
else if (strcmp(av[i], "--configtest") == 0)
{
load_config(verbose);
if (hash_get("ApplyFileSpec") != NULL)
FileSpecActiveProfils(hash_get("ApplyFileSpec"), verbose);
(void) printf("Config is valid.\n");
exit(0);
}
else if (strcmp(av[i], "--help") == 0)
{
help: (void) printf("Build:\n\t");
showVersion(0);
(void) printf("\nUsage:\n\t%s [verbose] [options]\n\nOptions:\n",
av[0]);
(void) printf(
"\t--configtest : test the config file and show errors\n");
(void) printf("\t--help : show this screen\n");
(void) printf("\t--version : show version of MySecureShell\n");
(void) printf("\nVerbose:\n");
(void) printf("\t-v : add a level at verbose mode\n");
exit(0);
}
else if (strcmp(av[i], "--version") == 0)
{
showVersion(1);
exit(0);
}
else if (strcmp(av[i], "-v") == 0)
verbose++;
else
{
(void) printf("--- UNKNOW OPTION: %s ---\n\n", av[i]);
goto help;
}
}
示例10: m_exeName
AppOptions::AppOptions(int argc, const char* argv[])
: m_exeName(base::get_file_name(argv[0]))
, m_startUI(true)
, m_startShell(false)
, m_verboseEnabled(false)
, m_palette(m_po.add("palette").requiresValue("<filename>").description("Use a specific palette by default"))
, m_shell(m_po.add("shell").description("Start an interactive console to execute scripts"))
, m_batch(m_po.add("batch").mnemonic('b').description("Do not start the UI"))
, m_saveAs(m_po.add("save-as").requiresValue("<filename>").description("Save the last given document with other format"))
, m_scale(m_po.add("scale").requiresValue("<factor>").description("Resize all previous opened documents"))
, m_data(m_po.add("data").requiresValue("<filename.json>").description("File to store the sprite sheet metadata"))
, m_format(m_po.add("format").requiresValue("<format>").description("Format to export the data file (json-hash, json-array)"))
, m_sheet(m_po.add("sheet").requiresValue("<filename.png>").description("Image file to save the texture"))
, m_sheetWidth(m_po.add("sheet-width").requiresValue("<pixels>").description("Sprite sheet width"))
, m_sheetHeight(m_po.add("sheet-height").requiresValue("<pixels>").description("Sprite sheet height"))
, m_sheetPack(m_po.add("sheet-pack").description("Use a packing algorithm to avoid waste of space\nin the texture"))
, m_splitLayers(m_po.add("split-layers").description("Import each layer of the next given sprite as\na separated image in the sheet"))
, m_layer(m_po.add("layer").alias("import-layer").requiresValue("<name>").description("Include just the given layer in the sheet"))
, m_frameTag(m_po.add("frame-tag").requiresValue("<name>").description("Include tagged frames in the sheet"))
, m_ignoreEmpty(m_po.add("ignore-empty").description("Do not export empty frames/cels"))
, m_borderPadding(m_po.add("border-padding").requiresValue("<value>").description("Add padding on the texture borders"))
, m_shapePadding(m_po.add("shape-padding").requiresValue("<value>").description("Add padding between frames"))
, m_innerPadding(m_po.add("inner-padding").requiresValue("<value>").description("Add padding inside each frame"))
, m_trim(m_po.add("trim").description("Trim all images before exporting"))
, m_crop(m_po.add("crop").requiresValue("x,y,width,height").description("Crop all the images to the given rectangle"))
, m_filenameFormat(m_po.add("filename-format").requiresValue("<fmt>").description("Special format to generate filenames"))
, m_script(m_po.add("script").requiresValue("<filename>").description("Execute a specific script"))
, m_verbose(m_po.add("verbose").mnemonic('v').description("Explain what is being done"))
, m_help(m_po.add("help").mnemonic('?').description("Display this help and exits"))
, m_version(m_po.add("version").description("Output version information and exit"))
{
try {
m_po.parse(argc, argv);
m_verboseEnabled = m_po.enabled(m_verbose);
m_paletteFileName = m_po.value_of(m_palette);
m_startShell = m_po.enabled(m_shell);
if (m_po.enabled(m_help)) {
showHelp();
m_startUI = false;
}
else if (m_po.enabled(m_version)) {
showVersion();
m_startUI = false;
}
if (m_po.enabled(m_shell) || m_po.enabled(m_batch)) {
m_startUI = false;
}
}
catch (const std::runtime_error& parseError) {
std::cerr << m_exeName << ": " << parseError.what() << '\n'
<< "Try \"" << m_exeName << " --help\" for more information.\n";
m_startUI = false;
}
}
示例11: main
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
a.setApplicationName("qlabnetfake");
a.setApplicationVersion("0.0.1-pre-alpha");
server s;
//a.connect(&s,SIGNAL(wantAbort()),&a,SLOT(quit()));
QStringList arglist=a.arguments();
for (int i=0;i<arglist.size();i++) {
if (arglist.at(i)=="--version") {
showVersion();
return 0;
}
if (arglist.at(i)=="--help") {
showHelp();
return 0;
}
}
if (a.argc()>1) {
qDebug("There is command-line arguments, good...");
QString infile=arglist.at(1);
QFile file(infile);
if (file.exists()) {
qDebug()<<"Trying to open file " <<infile;
} else {
qCritical("File '%s' does not exist. Consider quit, bye!", qPrintable(infile));
return 1;
}
} else {
qWarning()<<"No file specified. Will try to open sample.dat\n";
qWarning("Run '%s infile'",qPrintable(arglist.at(0)));
QFile file("sample.dat");
if (QFile::exists("sample.dat")) {
s.setInFile("sample.dat");
} else {
qCritical("File 'sample.dat' does not exist. Consider quit, bye!");
return 1;
}
}
return a.exec();
}
示例12: main
int main(int argc, char *argv[])
{
int en_daemonize = 0;
int i;
for(i=1; i<argc; i++){
if (!strcmp(argv[i], "-d")) {
en_daemonize = 1;
//daemonize("/tmp", "/tmp/pikeyd.pid");
}
else if (!strcmp(argv[i], "-k")) {
daemonKill("/tmp/pikeyd.pid");
exit(0);
}
else if (!strcmp(argv[i], "-r")) {
force_repeat();
}
else if (!strcmp(argv[i], "-v")) {
showVersion();
exit(0);
}
else if (!strcmp(argv[i], "-h")) {
showHelp();
exit(0);
}
/* debug options */
else if (!strncmp(argv[i], "-D", 2)) {
int d = 1;
char *p = &argv[i][2];
if (argv[i][2]) {
d = strtol(&argv[i][2], &p, 10);
if (d > 10) {
d = 10;
}
}
if (*p) {
printf("Unknown -D option: %s\n", argv[i]);
exit(-1);
}
debug_init(d);
printf("DEBUG LEVEL %d\n", d);
}
else {
printf("Unknown command line argument: %s\n", argv[i]);
showHelp();
exit(-1);
}
}
if(en_daemonize){
daemonize("/tmp", "/tmp/pikeyd.pid");
}
<<<<<<< HEAD
示例13: main
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QTextCodec *tc = QTextCodec::codecForName("utf8");
QTextCodec::setCodecForCStrings(tc);
QString url = "http://www.yahoo.cn";
QWebSettings::setMaximumPagesInCache(20);
app.setApplicationName(VB_PRODUCT_NAME);
app.setApplicationVersion(
QString("%1.%2.%3")
.arg(VB_MAJORVERSION_NUMBER)
.arg(VB_MINORVERSION_NUMBER)
.arg(VB_PATCHLEVEL_NUMBER)
);
QCoreApplication::setOrganizationName("Yahoo China EEEE");
QCoreApplication::setOrganizationDomain("eeeeworks.org");
QCoreApplication::setApplicationName(VB_PRODUCT_NAME);
QWebSettings::setObjectCacheCapacities((16*1024*1024) / 8, (16*1024*1024) / 8, 16*1024*1024);
QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
const QStringList args = app.arguments();
QStringList jsFiles;
for (int i = 1; i < args.count(); i++) {
QString arg = args.at(i);
if (arg == "-h" || arg == "--help") {
//argHelp = true;
help(0);
} else if (arg.indexOf("--js=") == 0) {
QString jsFile = arg.split("=").at(1);
jsFiles.push_back(jsFile);
} else if (arg == "-v" || arg == "--version") {
showVersion(app);
return 0;
} else if (arg.indexOf("-") == 0) {
fprintf(stderr, "Invalid command-line option: %s\n\n", arg.toUtf8().data());
exit(1);
} else {
url = arg;
}
}
MainWindow window(url);
//qDebug() << "js files: " << jsFiles << endl;
if (jsFiles.count() > 0) {
window.setJSFiles(jsFiles);
}
window.show();
return app.exec();
}
示例14: m_impl
CLI::CLI(int & argc, char ** argv) :
m_impl(new Impl)
{
// Setup
dispatch_function_t stopHandler = [](void * ctx){ static_cast<CLI*>(ctx)->stop();};
m_impl->signalSourceINT = createSourceSignal(SIGINT, this, stopHandler);
m_impl->signalSourceTERM = createSourceSignal(SIGTERM, this, stopHandler);
// UI
showVersion();
parse(argc, argv);
}
示例15: myre_show_help
void
myre_show_help() {
showVersion();
gtk_text_buffer_set_text(text2, HELPMSG, -1);
gtk_widget_show(hboxmain);
gtk_widget_show(textview2);
gtk_widget_show(button2);
my_text_buffer_highlight(text2, "Mark : Site", 1);
my_text_buffer_highlight(text2, "Command word", 1);
my_text_buffer_highlight(text2, "Keyboard Control", 1);
restore_cursor_pos_after_highlight();
gtk_widget_grab_focus(textview2);
}