X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=e4dab917d2511b923773c5ea47481ebde177d354;hb=4feaaa4750ce382f5a349449d9c171051dc40a8f;hp=b962c3c924b829e752ab1eec51d201f1fa2c37b3;hpb=1bbd84b1ff8ed2a74522887499c8f2b5154eb363;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index b962c3c..e4dab91 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -126,7 +127,7 @@ usage (int status) " -v|--verbose Verbose messages\n" " -x Echo each command before executing it\n" " -V|--version Display version and exit\n" - "For more information, see the manpage %s(1).\n"), + "For more information, see the manpage %s(1).\n"), program_name, program_name, program_name, program_name, program_name, program_name, program_name, program_name, program_name); @@ -324,9 +325,12 @@ main (int argc, char *argv[]) guestfs_set_verbose (g, verbose); break; - case 'V': - printf ("%s %s\n", program_name, PACKAGE_VERSION); + case 'V': { + struct guestfs_version *v = guestfs_version (g); + printf ("%s %"PRIi64".%"PRIi64".%"PRIi64"%s\n", program_name, + v->major, v->minor, v->release, v->extra); exit (EXIT_SUCCESS); + } case 'x': guestfs_set_trace (g, 1);