Add command line flag for retrieving the picasso version (fix #11)
This commit is contained in:
parent
e5e8127a5d
commit
08e77dad03
@ -62,6 +62,7 @@ Usage: picasso [options] files...
|
|||||||
Options:
|
Options:
|
||||||
-o, --out=<file> Specifies the name of the SHBIN file to generate
|
-o, --out=<file> Specifies the name of the SHBIN file to generate
|
||||||
-h, --header=<file> Specifies the name of the header file to generate
|
-h, --header=<file> Specifies the name of the header file to generate
|
||||||
|
-v, --version Displays version information
|
||||||
```
|
```
|
||||||
|
|
||||||
DVLEs are generated in the same order as the files in the command line.
|
DVLEs are generated in the same order as the files in the command line.
|
||||||
|
@ -36,6 +36,7 @@ int usage(const char* prog)
|
|||||||
"Options:\n"
|
"Options:\n"
|
||||||
" -o, --out=<file> Specifies the name of the SHBIN file to generate\n"
|
" -o, --out=<file> Specifies the name of the SHBIN file to generate\n"
|
||||||
" -h, --header=<file> Specifies the name of the header file to generate\n"
|
" -h, --header=<file> Specifies the name of the header file to generate\n"
|
||||||
|
" -v, --version Displays version information\n"
|
||||||
, prog);
|
, prog);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
@ -49,17 +50,19 @@ int main(int argc, char* argv[])
|
|||||||
{ "out", required_argument, NULL, 'o' },
|
{ "out", required_argument, NULL, 'o' },
|
||||||
{ "header", required_argument, NULL, 'h' },
|
{ "header", required_argument, NULL, 'h' },
|
||||||
{ "help", no_argument, NULL, '?' },
|
{ "help", no_argument, NULL, '?' },
|
||||||
|
{ "version",no_argument, NULL, 'v' },
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
int opt, optidx = 0;
|
int opt, optidx = 0;
|
||||||
while ((opt = getopt_long(argc, argv, "o:h:?", long_options, &optidx)) != -1)
|
while ((opt = getopt_long(argc, argv, "o:h:?v", long_options, &optidx)) != -1)
|
||||||
{
|
{
|
||||||
switch (opt)
|
switch (opt)
|
||||||
{
|
{
|
||||||
case 'o': shbinFile = optarg; break;
|
case 'o': shbinFile = optarg; break;
|
||||||
case 'h': hFile = optarg; break;
|
case 'h': hFile = optarg; break;
|
||||||
case '?': usage(argv[0]); return EXIT_SUCCESS;
|
case '?': usage(argv[0]); return EXIT_SUCCESS;
|
||||||
|
case 'v': printf("%s - Built on %s %s\n", PACKAGE_STRING, __DATE__, __TIME__); return EXIT_SUCCESS;
|
||||||
default: return usage(argv[0]);
|
default: return usage(argv[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user