aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2013-08-01 21:09:19 +0000
committerMartin Kaiser <wireshark@kaiser.cx>2013-08-01 21:09:19 +0000
commit24c88b80072f39d90951dbc8375048b860d81c7a (patch)
tree16c0f39d91a14e932608524c76bf1a621c5dffdf /tshark.c
parentbee464590be706a899f116ac000dca2c6a8ce313 (diff)
pass --capture-comment from tshark to dumpcap
handle error cases in tshark svn path=/trunk/; revision=51094
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tshark.c b/tshark.c
index a302687e1b..08803e0af9 100644
--- a/tshark.c
+++ b/tshark.c
@@ -1686,6 +1686,12 @@ main(int argc, char *argv[])
"a capture isn't being done.");
return 1;
}
+ if (global_capture_opts.capture_comment) {
+ cmdarg_err("A capture comment was specified, but "
+ "a capture isn't being done.\nThere's no support for adding "
+ "a capture comment to an existing capture file.");
+ return 1;
+ }
/* Note: TShark now allows the restriction of a _read_ file by packet count
* and byte count as well as a write file. Other autostop options remain valid
@@ -1708,6 +1714,10 @@ main(int argc, char *argv[])
cmdarg_err("Live captures can only be saved in libpcap format.");
return 1;
}
+ if (global_capture_opts.capture_comment && out_file_type != WTAP_FILE_PCAPNG) {
+ cmdarg_err("A capture comment can only be written to a pcapng file.");
+ return 1;
+ }
if (global_capture_opts.multi_files_on) {
/* Multiple-file mode doesn't work under certain conditions:
a) it doesn't work if you're writing to the standard output;
@@ -1754,6 +1764,11 @@ main(int argc, char *argv[])
"the capture isn't being saved to a file.");
return 1;
}
+ if (global_capture_opts.capture_comment) {
+ cmdarg_err("A capture comment was specified, but "
+ "the capture isn't being saved to a file.");
+ return 1;
+ }
}
}
}