mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2025-01-08 16:58:46 +08:00
Add a #define for the short options and put it above the long options.
That puts all the option lists together; hopefully this encourages developers who want to add a new flag to read the big "don't use these options, other tcpdumps use them for their own purposes" command and thus *dis*courages them from using one of those options.
This commit is contained in:
parent
f08eb851ee
commit
2f63616362
13
tcpdump.c
13
tcpdump.c
@ -607,6 +607,15 @@ show_devices_and_exit (void)
|
||||
*
|
||||
* OS X tcpdump uses -P to indicate that -w should write pcap-ng rather
|
||||
* than pcap files.
|
||||
*
|
||||
* OS X tcpdump also uses -Q to specify expressions that match packet
|
||||
* metadata, including but not limited to the packet direction.
|
||||
* The expression syntax is different from a simple "in|out|inout",
|
||||
* and those expressions aren't accepted by OS X tcpdump, but the
|
||||
* equivalents would be "in" = "dir=in", "out" = "dir=out", and
|
||||
* "inout" = "dir=in or dir=out", and the parser could conceivably
|
||||
* special-case "in", "out", and "inout" as expressions for backwards
|
||||
* compatibility, so all is not (yet) lost.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -655,6 +664,8 @@ show_devices_and_exit (void)
|
||||
#define Q_FLAG
|
||||
#endif
|
||||
|
||||
#define SHORTOPTS "aAb" B_FLAG "c:C:d" D_FLAG "eE:fF:G:hHi:" I_FLAG j_FLAG J_FLAG "KlLm:M:nNOpq" Q_FLAG "r:Rs:StT:u" U_FLAG "vV:w:W:xXy:Yz:Z:#"
|
||||
|
||||
/*
|
||||
* Long options.
|
||||
*
|
||||
@ -1061,7 +1072,7 @@ main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
while (
|
||||
(op = getopt_long(argc, argv, "aAb" B_FLAG "c:C:d" D_FLAG "eE:fF:G:hHi:" I_FLAG j_FLAG J_FLAG "KlLm:M:nNOpq" Q_FLAG "r:Rs:StT:u" U_FLAG "vV:w:W:xXy:Yz:Z:#", longopts, NULL)) != -1)
|
||||
(op = getopt_long(argc, argv, SHORTOPTS, longopts, NULL)) != -1)
|
||||
switch (op) {
|
||||
|
||||
case 'a':
|
||||
|
Loading…
Reference in New Issue
Block a user