1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-01 08:29:41 +02:00

add print version

This commit is contained in:
Xiangfu Liu 2011-04-08 16:36:51 +08:00
parent c9f7c85607
commit 2a49d71627

View File

@ -24,6 +24,7 @@
#include "devmgr.h" #include "devmgr.h"
#include "ingenic.h" #include "ingenic.h"
#include "shell.h" #include "shell.h"
#include "xburst-tools-config.h"
static void usage(const char *app) { static void usage(const char *app) {
printf( printf(
@ -39,7 +40,8 @@ static void usage(const char *app) {
" -c <CMD> Run semicolon-separated commands and exit\n" " -c <CMD> Run semicolon-separated commands and exit\n"
" -d <DEBUG> Set output level (0 - no reporting, 4 - max reporting), default = 1 (errors only)\n" " -d <DEBUG> Set output level (0 - no reporting, 4 - max reporting), default = 1 (errors only)\n"
" -C <FILE> Execute configuration script FILE before anything else\n" " -C <FILE> Execute configuration script FILE before anything else\n"
" -b <FILE> Execute script in FILE\n\n", app); " -b <FILE> Execute script in FILE\n"
" -v Print program version\n\n", app);
} }
static void dev_handler(int idx, uint16_t vid, uint16_t pid, void *data) { static void dev_handler(int idx, uint16_t vid, uint16_t pid, void *data) {
@ -51,7 +53,7 @@ int main(int argc, char *argv[]) {
int idx = -1, enumerate = 0; int idx = -1, enumerate = 0;
char *cmd = NULL, *script = NULL, *config = NULL; char *cmd = NULL, *script = NULL, *config = NULL;
while((ch = getopt(argc, argv, "b:i:ec:d:C:")) != -1) { while((ch = getopt(argc, argv, "b:i:ec:d:C:v")) != -1) {
switch(ch) { switch(ch) {
case 'e': case 'e':
enumerate = 1; enumerate = 1;
@ -83,6 +85,11 @@ int main(int argc, char *argv[]) {
break; break;
case 'v':
printf("%s %s\n", argv[0], PACKAGE_VERSION);
return 0;
default: default:
usage(argv[0]); usage(argv[0]);