Wireshark mailing list archives
Re: Wireshark-dev] Linking error tfshark
From: Jeff Morriss <jeff.morriss.ws () gmail com>
Date: Sat, 11 Jan 2014 15:40:23 -0500
On 01/11/2014 03:05 PM, mmann78 () netscape net wrote:
Patch committed to rev 54697. The issue with tfshark -V option isn't the option itself, its the OPTSTRING string. I stripped it down from tshark (removing options that shouldn't be supported in tfshark) and apparently "broke" the string pattern so that getopt isn't parsing the options correctly. As a test, I restored it to the current tshark OPTSTRING and the -V option worked just fine. Can someone point me to where I can understand the OPTSTRING syntax? The :'s seem arbitrary to me.
man -s 3 getopt ? A bit from the Linux version:
optstring is a string containing the legitimate option characters. If such a character is followed by a colon, the option requires an argu‐ ment, so getopt() places a pointer to the following text in the same argv-element, or the text of the following argv-element, in optarg. Two colons mean an option takes an optional arg; if there is text in the current argv-element (i.e., in the same word as the option name itself, for example, "-oarg"), then it is returned in optarg, otherwise optarg is set to zero. This is a GNU extension. If optstring contains W followed by a semicolon, then -W foo is treated as the long option --foo. (The -W option is reserved by POSIX.2 for implementation exten‐ sions.) This behavior is a GNU extension, not available with libraries before glibc 2.
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Linking error tfshark Joerg Mayer (Jan 08)
- Re: Linking error tfshark mmann78 (Jan 08)
- Re: Linking error tfshark Michal Labedzki (Jan 10)
- Re: Linking error tfshark mmann78 (Jan 10)
- Re: Linking error tfshark Michal Labedzki (Jan 10)
- Re: Linking error tfshark Joerg Mayer (Jan 10)
- Message not available
- Wireshark-dev] Linking error tfshark mmann78 (Jan 11)
- Re: Wireshark-dev] Linking error tfshark Jeff Morriss (Jan 11)
- Re: Wireshark-dev] Linking error tfshark Christopher Maynard (Jan 11)
- Re: Linking error tfshark Michal Labedzki (Jan 10)
- Re: Linking error tfshark mmann78 (Jan 08)
- Re: Linking error tfshark Joerg Mayer (Jan 10)