Print superiotool version when run with --verbose.
Signed-off-by: Robinson P. Tryon <bishop.robinson@gmail.com> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2818 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
0de6f0a36f
commit
ec1edd1cd9
@ -169,10 +169,19 @@ void no_superio_found(const char *vendor, const char *info, uint16_t port)
|
|||||||
port, inb(port), inb(port + 1));
|
port, inb(port), inb(port + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void print_version(void)
|
||||||
|
{
|
||||||
|
char tmp[80];
|
||||||
|
|
||||||
|
strncpy((char *)&tmp,
|
||||||
|
(const char *)&SUPERIOTOOL_VERSION[6],
|
||||||
|
strlen(SUPERIOTOOL_VERSION) - 8);
|
||||||
|
printf("superiotool r%s\n", (char *)&tmp);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i, j, opt, option_index;
|
int i, j, opt, option_index;
|
||||||
char tmp[80];
|
|
||||||
|
|
||||||
const static struct option long_options[] = {
|
const static struct option long_options[] = {
|
||||||
{"dump", no_argument, NULL, 'd'},
|
{"dump", no_argument, NULL, 'd'},
|
||||||
@ -193,13 +202,12 @@ int main(int argc, char *argv[])
|
|||||||
dump_readable = 1;
|
dump_readable = 1;
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
|
/* Print version in --verbose mode. */
|
||||||
|
print_version();
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
strncpy((char *)&tmp,
|
print_version();
|
||||||
(const char *)&SUPERIOTOOL_VERSION[6],
|
|
||||||
strlen(SUPERIOTOOL_VERSION) - 8);
|
|
||||||
printf("superiotool r%s\n", (char *)&tmp);
|
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user