projects
/
nbd.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c885687
)
Implement basic --help option
author
Wouter Verhelst <w@uter.be>
Fri, 27 May 2011 23:11:25 +0000
(
01:11
+0200)
committer
Wouter Verhelst <w@uter.be>
Fri, 27 May 2011 23:11:25 +0000
(
01:11
+0200)
nbd-trdump.c
patch
|
blob
|
history
diff --git
a/nbd-trdump.c
b/nbd-trdump.c
index
49f4f9e
..
82b7688
100644
(file)
--- a/
nbd-trdump.c
+++ b/
nbd-trdump.c
@@
-43,6
+43,17
@@
int main(int argc, char**argv) {
char * ctext;
int readfd = 0; /* stdin */
char * ctext;
int readfd = 0; /* stdin */
+ if(argc > 1) {
+ int retval=0;
+ if(strcmp(argv[1], "--help") && strcmp(argv[1], "-h")) {
+ printf("E: unknown option %s.\n", argv[1]);
+ retval=1;
+ }
+ printf("This is nbd-trdump, part of nbd %s.\n", PACKAGE_VERSION);
+ printf("Use: %s < transactionlog\n", argv[0]);
+ return retval;
+ }
+
while (1) {
/* Read a request or reply from the transaction file */
doread(readfd, &magic, sizeof(magic));
while (1) {
/* Read a request or reply from the transaction file */
doread(readfd, &magic, sizeof(magic));