git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
edd99a3
)
Add --version option (show version) to guestfish.
author
Richard Jones
<rjones@redhat.com>
Sun, 26 Apr 2009 11:11:23 +0000
(12:11 +0100)
committer
Richard Jones
<rjones@redhat.com>
Sun, 26 Apr 2009 11:11:23 +0000
(12:11 +0100)
fish/fish.c
patch
|
blob
|
history
diff --git
a/fish/fish.c
b/fish/fish.c
index
c8e9506
..
a5fc337
100644
(file)
--- a/
fish/fish.c
+++ b/
fish/fish.c
@@
-100,13
+100,14
@@
usage (void)
" -n|--no-sync Don't autosync\n"
" -r|--ro Mount read-only\n"
" -v|--verbose Verbose messages\n"
" -n|--no-sync Don't autosync\n"
" -r|--ro Mount read-only\n"
" -v|--verbose Verbose messages\n"
+ " -V|--version Display version and exit\n"
"For more information, see the manpage guestfish(1).\n");
}
int
main (int argc, char *argv[])
{
"For more information, see the manpage guestfish(1).\n");
}
int
main (int argc, char *argv[])
{
- static const char *options = "a:h::m:nrv?";
+ static const char *options = "a:h::m:nrv?
V
";
static struct option long_options[] = {
{ "add", 1, 0, 'a' },
{ "cmd-help", 2, 0, 'h' },
static struct option long_options[] = {
{ "add", 1, 0, 'a' },
{ "cmd-help", 2, 0, 'h' },
@@
-115,6
+116,7
@@
main (int argc, char *argv[])
{ "no-sync", 0, 0, 'n' },
{ "ro", 0, 0, 'r' },
{ "verbose", 0, 0, 'v' },
{ "no-sync", 0, 0, 'n' },
{ "ro", 0, 0, 'r' },
{ "verbose", 0, 0, 'v' },
+ { "version", 0, 0, 'V' },
{ 0, 0, 0, 0 }
};
struct mp *mps = NULL;
{ 0, 0, 0, 0 }
};
struct mp *mps = NULL;
@@
-200,6
+202,10
@@
main (int argc, char *argv[])
guestfs_set_verbose (g, verbose);
break;
guestfs_set_verbose (g, verbose);
break;
+ case 'V':
+ printf ("guestfish %s\n", PACKAGE_VERSION);
+ exit (0);
+
case '?':
usage ();
exit (0);
case '?':
usage ();
exit (0);