Re: [Autogen-users] easiest way to print a custom version string
Brought to you by:
bkorb
From: Bruce K. <bru...@gm...> - 2014-06-24 00:44:52
|
Never mind. I was on a long hold and looked at the code. The answer jumped out at me: print_ver() gets a new argument to indicate, "please do not exit" and I add: /*=export_func optionPrintVersionAndReturn * private: * * what: Print the program version * arg: + tOptions* + opts + program options descriptor + * arg: + tOptDesc* + od + the descriptor for this arg + * * doc: * This routine will print the version to stdout. =*/ void optionPrintVersionAndReturn(tOptions * opts, tOptDesc * od) { print_ver(opts, od, print_exit ? stderr : stdout, false); } "false" meaning "don't call exit()". http://autogen.sourceforge.net/data/autogen-5.18.4pre4.tar.xz On Mon, Jun 23, 2014 at 1:27 PM, Bruce Korb <bru...@gm...> wrote: > On 06/23/14 12:08, Nikos Mavrogiannopoulos wrote: >> >> On Mon, 2014-06-23 at 10:30 -0700, Bruce Korb wrote: >> On 06/22/14 03:53, Nikos Mavrogiannopoulos wrote: >>>> >>>> Hello, >>>> I'd like to override the default version string >>> >>> >>> Specify a "version-proc": >>> >>> >>> http://www.gnu.org/software/autogen/manual/html_node/automatic-options.html#automatic-options >>> >>> third paragraph. :) >> >> >> Thanks, that seems to be very close to what I want. The issue is that >> I can't combine it with optionPrintVersion(), as optionPrintVersion() >> exits, so I'd have to duplicate printing the license message, and bugs >> address. Anyway maybe, I'm nitpicking, I think it is ok by having a >> more terse version text. > > > Ah. Then: > > OPT_SET_VERSION_DOES_NOT_EXIT(&progOptions); > optionPrintVersion(&progOptions, progOptions.pOptDesc + INDEX_OPT_HELP); > > I still have 6 bits in the OPTPROC_* flags, before I have to do something > disruptive. Won't be doing it today though. :) |