From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Block To: dje@transmeta.com, "H. J. Lu" , phdm@macqel.be, dj@delorie.com, binutils@sourceware.cygnus.com Subject: Re: [PATCH]Add --style switch to binutils Date: Fri, 23 Jun 2000 06:57:00 -0000 Message-id: <39536C9F.6237F5C@zk3.dec.com> References: <200006230901.LAA31979@mail.macqel.be> X-SW-Source: 2000-06/msg00490.html Philippe De Muyter wrote: > Ken Block wrote : > > If people would prefer --style be --demangler, I have no objections. > > --style is what is used in H.J. Lu's binutils. Previously, it was > > --lang. > > > > There is another switch --demangler which takes the name of a shared > > object and an entry point. These are used to dynamically load a > > demangler from a shared object. > > > > [...] > > > > DJ Delorie wrote: > > > > > "--style" sounds like an awfully generic name. How about > > > "--demangler" instead? > > > How about --mangling-style ? Either is fine with me. Basically, there are currently 3 switches for demangling under H.J's binutils. --[no-]demangle -- enables/disables demangling --style -- set mangling style to a known demangling style like GNU, HP, etc. --demangler -- uses a demangler that is external to the tool to perform demangling. So for example, to say I want to use "nm" and have it demangle using the "HP" style, I do: nm --demangle --style=HP. I proposed to H.J. that we consolidate the --style swtich and the --demangler switch and have the argument be overloaded. That if you say "--demangler=HP" you get the HP demangler, but if you say "--demangler=foo:bar" you get the external demangler looked up as foo with the parameter bar. I was wondering if it was further possible to fold the --demangle and the --demangler switch together such that I could say "nm --demangle" and get the default demangling or "nm --demangle=HP". Is this possible to do within getopt? If I say "nm --demangle t.o", I do not want t.o be interpreted as the optional argument. My understand of getopts is that if an argument is optional, it must be provided in the --switch=arg form, --switch form is disallowed. So this should work. So the documentation should become: --[no-]demangle[=