1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-22 06:54:59 +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 "ingenic.h"
#include "shell.h"
#include "xburst-tools-config.h"
static void usage(const char *app) {
printf(
@ -39,7 +40,8 @@ static void usage(const char *app) {
" -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"
" -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) {
@ -51,7 +53,7 @@ int main(int argc, char *argv[]) {
int idx = -1, enumerate = 0;
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) {
case 'e':
enumerate = 1;
@ -83,6 +85,11 @@ int main(int argc, char *argv[]) {
break;
case 'v':
printf("%s %s\n", argv[0], PACKAGE_VERSION);
return 0;
default:
usage(argv[0]);