https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=212135acf1be102c98760d7dbeb7cc92ef998a71 commit 212135acf1be102c98760d7dbeb7cc92ef998a71 Author: Jon Turney Date: Thu Jun 16 21:03:18 2022 +0100 Update README https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=7d12fb07114647a57bb0c37aab99a8c4ff900b8d commit 7d12fb07114647a57bb0c37aab99a8c4ff900b8d Author: Jon Turney Date: Fri Jun 17 10:23:10 2022 +0100 Also localize options helptext framing text https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=e11d78063bfa1347a0c66af6cb6f9bf93c1f6ce5 commit e11d78063bfa1347a0c66af6cb6f9bf93c1f6ce5 Author: Jon Turney Date: Thu Jun 16 21:03:01 2022 +0100 Enable maintainer mode for libgetopt++ AM_MAINTAINER_MODE without an argument means --disable-maintainer-mode by default, which isn't what's wanted. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=0842d2e3a3c280fcce1ce780c77ab7c766dcae0b commit 0842d2e3a3c280fcce1ce780c77ab7c766dcae0b Author: Jon Turney Date: Thu Jun 16 20:14:20 2022 +0100 Add a GitHub workflow for building on Cygwin https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=3f7be6270618acdf9dddbcd6ffd6ea9e03171cf9 commit 3f7be6270618acdf9dddbcd6ffd6ea9e03171cf9 Author: Jon Turney Date: Thu Jun 16 17:03:03 2022 +0100 Try to ensure console output is correctly encoded Previously, all log messages were ASCII, so this wasn't a concern. Now that log may contain UTF-8, we need to ensure that appears correctly. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=6ac90bf08213d9b7a20fc9f086fb89601a7a2019 commit 6ac90bf08213d9b7a20fc9f086fb89601a7a2019 Author: Jon Turney Date: Thu Jun 16 22:05:05 2022 +0100 Add French translations of option help-text Also make some minor adjustments to help-texts for consistency: * --no-warn-deprecated-windows should start "Don't" * --categories doesn't need to say "entire" * --download and --local-install no longer say "seulement" https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=20f237b4e884af7992c5b5e270301684f64d0395 commit 20f237b4e884af7992c5b5e270301684f64d0395 Author: Jon Turney Date: Thu Jun 16 13:57:38 2022 +0100 Add command-line option help-text localization Change libgetopt++ Option class to store an unsigned int message catalog identifer for the help-text, rather than a std::string of the help-text. ParameterUsage (the function which produces the help output) now takes a lookup function as a parameter, which translates that message identifer to a localized std::string. Move existing help-text to a stringtable resource, and then wire up ParameterUsage to use LoadString. Update libgetop++ tests appropriately. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=b0bd16950669290e488dc382051f7f28f2278eef commit b0bd16950669290e488dc382051f7f28f2278eef Author: Jon Turney Date: Mon Jun 13 14:54:50 2022 +0100 Fix '-t -P package-with-only-a-test-version' Fix how 'install any version' operates in that case. Also make '-t' have an effect when used with '-P' but without '-g'. Future work: The language around '-t' perhaps needs refining, since it's absence just lowers the priority of test packages, not prohibiting their use (so in this particular case, package-with-only-a-test-version will be installed, even without '-t') https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=9ea9db8ff367b21efe0ed9a7ada0e1e697751518 commit 9ea9db8ff367b21efe0ed9a7ada0e1e697751518 Author: Jon Turney Date: Tue Jun 14 22:03:48 2022 +0100 Improve consistency of ending sentences with a full-stop Improve the consistency between translations of ending sentences with a full-stop. Always end the sentence under the page title with a full-stop. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=35152c83ad51db6ada7f072bc57318d30a44e459 commit 35152c83ad51db6ada7f072bc57318d30a44e459 Author: Jon Turney Date: Wed Jun 15 14:49:38 2022 +0100 Tidy up spacing in french translation Consistently use a space before ':' (apparently "space before and after full-height punctuation" is a standard typographical rule for French). Remove unneeded trailing whitespace. Diff: --- .github/workflows/cygwin.yml | 53 +++++ AntiVirus.cc | 2 +- LogFile.cc | 25 ++- README | 17 +- String++.cc | 7 +- String++.h | 3 +- choose.cc | 13 +- crypto.cc | 17 +- desktop.cc | 6 +- ini.cc | 4 +- install.cc | 4 +- io_stream_cygfile.cc | 4 +- libgetopt++/configure.ac | 1 - libgetopt++/include/getopt++/BoolOption.h | 6 +- libgetopt++/include/getopt++/DefaultFormatter.h | 13 +- libgetopt++/include/getopt++/Option.h | 2 +- libgetopt++/include/getopt++/OptionSet.h | 4 +- libgetopt++/include/getopt++/StringArrayOption.h | 8 +- libgetopt++/include/getopt++/StringChoiceOption.h | 2 +- libgetopt++/include/getopt++/StringOption.h | 8 +- libgetopt++/src/BoolOption.cc | 4 +- libgetopt++/src/OptionSet.cc | 4 +- libgetopt++/src/StringArrayOption.cc | 4 +- libgetopt++/src/StringChoiceOption.cc | 2 +- libgetopt++/src/StringOption.cc | 4 +- libgetopt++/tests/BoolOptionTest.cc | 6 +- libgetopt++/tests/OptionSet.cc | 10 +- libgetopt++/tests/optioniterator.cc | 2 +- libgetopt++/tests/testoption.cc | 13 +- libsolv.cc | 13 +- localdir.cc | 2 +- main.cc | 38 ++-- net.cc | 2 +- nio-ie5.cc | 2 +- package_db.cc | 2 +- package_meta.cc | 8 +- po/fr/res.po | 235 ++++++++++++++++++++-- prereq.cc | 2 +- res.pot | 209 ++++++++++++++++++- res/en/res.rc | 66 +++++- res/fr/res.rc | 74 ++++++- resource.h | 49 +++++ root.cc | 2 +- site.cc | 5 +- source.cc | 4 +- win32.cc | 7 + win32.h | 1 + 47 files changed, 820 insertions(+), 149 deletions(-) diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml new file mode 100644 index 00000000..b406c5eb --- /dev/null +++ b/.github/workflows/cygwin.yml @@ -0,0 +1,53 @@ +name: Cygwin + +on: push + +jobs: + cygwin-build: + name: Cygwin + runs-on: windows-latest + + strategy: + fail-fast: false + matrix: + include: + - pkgarch: i686 + - pkgarch: x86_64 + + steps: + - run: git config --global core.autocrlf input + + # fetch all history for all tags for 'git describe' + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install Cygwin + uses: cygwin/cygwin-install-action@master + with: + packages: >- + autoconf, + automake, + bison, + flex, + libtool, + make, + mingw64-${{ matrix.pkgarch }}-bzip2, + mingw64-${{ matrix.pkgarch }}-gcc-g++, + mingw64-${{ matrix.pkgarch }}-headers, + mingw64-${{ matrix.pkgarch }}-libgcrypt, + mingw64-${{ matrix.pkgarch }}-libsolv, + mingw64-${{ matrix.pkgarch }}-xz, + mingw64-${{ matrix.pkgarch }}-zlib, + mingw64-${{ matrix.pkgarch }}-zstd, + upx + + - name: Build + run: packaging-scripts/conf.sh upx ${{ matrix.pkgarch }} + shell: bash --noprofile --norc -eo pipefail '{0}' + + - name: Test + run: >- + export PATH=/usr/${{ matrix.pkgarch }}-w64-mingw32/sys-root/mingw/bin/:${PATH} && + make -C ${{ matrix.pkgarch }} check + shell: bash --noprofile --norc -eo pipefail '{0}' diff --git a/AntiVirus.cc b/AntiVirus.cc index 051a434d..cc416cc7 100644 --- a/AntiVirus.cc +++ b/AntiVirus.cc @@ -31,7 +31,7 @@ /* XXX: Split this into observer and model classes */ /* Default is to leave well enough alone */ -static BoolOption DisableVirusOption (false, 'A', "disable-buggy-antivirus", "Disable known or suspected buggy anti virus software packages during execution."); +static BoolOption DisableVirusOption (false, 'A', "disable-buggy-antivirus", IDS_HELPTEXT_DISABLE_ANTIVIRUS); static bool KnownAVIsPresent = false; static bool AVRunning = true; diff --git a/LogFile.cc b/LogFile.cc index 0a83159f..ab2e3ec9 100644 --- a/LogFile.cc +++ b/LogFile.cc @@ -33,8 +33,7 @@ #include "String++.h" #include "getopt++/BoolOption.h" -static BoolOption VerboseOutput (false, 'v', "verbose", - "Verbose output"); +static BoolOption VerboseOutput (false, 'v', "verbose", IDS_HELPTEXT_VERBOSE); /* private helper class */ class filedef @@ -215,7 +214,27 @@ LogFile::endEntry() /* also write to stdout */ if ((currEnt->level >= LOG_PLAIN) || VerboseOutput) - std::cout << buf << std::endl; + { + /* + The log message is UTF-8 encoded. Re-encode this in the console output + codepage (so it can be correctly decoded by a Windows terminal). + Unfortunately there's no API for direct multibyte re-encoding, so we + must do it in two steps UTF-8 -> UTF-16 -> CP_COCP. + + If the console output codepage is UTF-8, we already have the log message + in the correct encoding, so we can avoid doing all that work. + + If the output is not a console, GetConsoleOutputCP() returns 0. + Possibly it's a Cygwin pty? + */ + std::string cpbuf = buf; + + unsigned int ocp = GetConsoleOutputCP(); + if ((ocp != 0 ) && (ocp != 65001)) + cpbuf = wstring_to_string(string_to_wstring(buf), ocp); + + std::cout << cpbuf << std::endl; + } if (!currEnt) { diff --git a/README b/README index b8f3f7cf..9bcf7b35 100644 --- a/README +++ b/README @@ -99,6 +99,19 @@ Follow the general directions given in the Cygwin contributions document: https://cygwin.com/contrib.html The appropriate mailing list for this project is cygwin-apps -(rather than cygwin-patches). Thus, the appropriate final command would be: +(rather than cygwin-patches). Thus an appropriate configuration is: - $ git send-email --to="cygwin-apps@cygwin.com" + $ git config --local format.subjectprefix "PATCH setup" + $ git config --local sendemail.to "cygwin-apps@cygwin.com" + +Before sending patches with: + + $ git format-patch [--cover-letter] + $ git send-email *.patch + + +TRANSLATIONS +------------ + +Translations of the gettext template res.pot can be made using PO file tools, or +online at https://hosted.weblate.org/projects/cygwin-setup/cygwin-setup/ diff --git a/String++.cc b/String++.cc index a5649759..9506b9e3 100644 --- a/String++.cc +++ b/String++.cc @@ -11,7 +11,6 @@ */ #include "String++.h" -#include "win32.h" #include #include #include @@ -116,15 +115,15 @@ std::wstring string_to_wstring(const std::string &s) } // convert a UTF-16 wstring to a UTF-8 string -std::string wstring_to_string(const std::wstring &w) +std::string wstring_to_string(const std::wstring &w, unsigned int encoding) { - int n = WideCharToMultiByte(CP_UTF8, 0, w.c_str(), -1, NULL, 0, NULL, NULL); + int n = WideCharToMultiByte(encoding, 0, w.c_str(), -1, NULL, 0, NULL, NULL); if (n <= 0) return "conversion failed"; char *buf = new char[n+1]; - WideCharToMultiByte(CP_UTF8, 0, w.c_str(), -1, buf, n, NULL, NULL); + WideCharToMultiByte(encoding, 0, w.c_str(), -1, buf, n, NULL, NULL); std::string s(buf); delete[] buf; diff --git a/String++.h b/String++.h index af32611c..caaf75f8 100644 --- a/String++.h +++ b/String++.h @@ -14,6 +14,7 @@ #define SETUP_STRING___H #include +#include "win32.h" char *new_cstr_char_array (const std::string& s); @@ -43,7 +44,7 @@ inline std::string operator+ (const char *a, const std::string& b) { return std::string(a) + b; } std::wstring string_to_wstring(const std::string &s); -std::string wstring_to_string(const std::wstring &w); +std::string wstring_to_string(const std::wstring &w, unsigned int encoding = CP_UTF8); // produce a std::string using formatting like sprintf std::wstring vformat(const std::wstring &fmt, va_list ap); diff --git a/choose.cc b/choose.cc index 1b18bbd0..8deab874 100644 --- a/choose.cc +++ b/choose.cc @@ -59,11 +59,11 @@ #include "Exception.h" #include "getopt++/BoolOption.h" -static BoolOption UpgradeAlsoOption (false, 'g', "upgrade-also", "Also upgrade installed packages"); -static BoolOption CleanOrphansOption (false, 'o', "delete-orphans", "Remove orphaned packages"); -static BoolOption ForceCurrentOption (false, 'f', "force-current", "Select the current version for all packages"); -static BoolOption PruneInstallOption (false, 'Y', "prune-install", "Prune the installation to only the requested packages"); -static BoolOption AllowTestOption (false, 't', "allow-test-packages", "Consider package versions marked test"); +static BoolOption UpgradeAlsoOption (false, 'g', "upgrade-also", IDS_HELPTEXT_UPGRADE_ALSO); +static BoolOption CleanOrphansOption (false, 'o', "delete-orphans", IDS_HELPTEXT_DELETE_ORPHANS); +static BoolOption ForceCurrentOption (false, 'f', "force-current", IDS_HELPTEXT_FORCE_CURRENT); +static BoolOption PruneInstallOption (false, 'Y', "prune-install", IDS_HELPTEXT_PRUNE_INSTALL); +static BoolOption AllowTestOption (false, 't', "allow-test-packages", IDS_HELPTEXT_ALLOW_TEST); extern ThreeBarProgressPage Progress; @@ -166,7 +166,6 @@ ChooserPage::initialUpdateState() if (ForceCurrentOption) { update_mode_id = IDC_CHOOSE_SYNC; - changeTrust(update_mode_id, AllowTestOption, true); } else if (hasManualSelections && !UpgradeAlsoOption) { @@ -177,8 +176,8 @@ ChooserPage::initialUpdateState() else { update_mode_id = IDC_CHOOSE_BEST; - changeTrust (update_mode_id, AllowTestOption, true); } + changeTrust(update_mode_id, AllowTestOption, true); static int ta[] = { IDC_CHOOSE_KEEP, IDC_CHOOSE_BEST, IDC_CHOOSE_SYNC, 0 }; rbset (GetHWND (), ta, update_mode_id); diff --git a/crypto.cc b/crypto.cc index 88ced387..a837f8da 100644 --- a/crypto.cc +++ b/crypto.cc @@ -42,18 +42,11 @@ #endif /* Command-line options for specifying and controlling extra keys. */ -static StringArrayOption ExtraKeyOption ('K', "pubkey", - "URL or absolute path of extra public key file (RFC4880 format)"); - -static StringArrayOption SexprExtraKeyOption ('S', "sexpr-pubkey", - "Extra DSA public key in s-expr format"); - -static BoolOption UntrustedKeysOption (false, 'u', "untrusted-keys", - "Use untrusted saved extra keys"); -static BoolOption KeepUntrustedKeysOption (false, 'U', "keep-untrusted-keys", - "Use untrusted keys and retain all"); -static BoolOption EnableOldKeysOption (false, '\0', "old-keys", - "Enable old cygwin.com keys", +static StringArrayOption ExtraKeyOption ('K', "pubkey", IDS_HELPTEXT_PUBKEY); +static StringArrayOption SexprExtraKeyOption ('S', "sexpr-pubkey", IDS_HELPTEXT_SEXPR_PUBKEY); +static BoolOption UntrustedKeysOption (false, 'u', "untrusted-keys", IDS_HELPTEXT_UNTRUSTED_KEYS); +static BoolOption KeepUntrustedKeysOption (false, 'U', "keep-untrusted-keys", IDS_HELPTEXT_KEEP_UNTRUSTED_KEYS); +static BoolOption EnableOldKeysOption (false, '\0', "old-keys", IDS_HELPTEXT_OLD_KEYS, BoolOption::BoolOptionType::pairedAble); /* Embedded public half of Cygwin signing key. */ diff --git a/desktop.cc b/desktop.cc index aa1f9019..4b76568c 100644 --- a/desktop.cc +++ b/desktop.cc @@ -40,9 +40,9 @@ #include "getopt++/BoolOption.h" #include "LogFile.h" -static BoolOption NoShortcutsOption (false, 'n', "no-shortcuts", "Disable creation of desktop and start menu shortcuts"); -static BoolOption NoStartMenuOption (false, 'N', "no-startmenu", "Disable creation of start menu shortcut"); -static BoolOption NoDesktopOption (false, 'd', "no-desktop", "Disable creation of desktop shortcut"); +static BoolOption NoShortcutsOption (false, 'n', "no-shortcuts", IDS_HELPTEXT_NO_SHORTCUTS); +static BoolOption NoStartMenuOption (false, 'N', "no-startmenu", IDS_HELPTEXT_NO_STARTMENU); +static BoolOption NoDesktopOption (false, 'd', "no-desktop", IDS_HELPTEXT_NO_DESKTOP); /* Lines starting with '@' are conditionals - include 'N' for NT, '5' for Win95, '8' for Win98, '*' for all, like this: diff --git a/ini.cc b/ini.cc index 1fd39ba1..3ef13118 100644 --- a/ini.cc +++ b/ini.cc @@ -61,8 +61,8 @@ std::string ini_setup_version; IniList setup_ext_list (setup_exts, setup_exts + (sizeof(setup_exts) / sizeof(*setup_exts))); -static BoolOption NoVerifyOption (false, 'X', "no-verify", "Don't verify setup.ini signatures"); -static BoolOption NoVersionCheckOption (false, '\0', "no-version-check", "Suppress checking if a newer version of setup is available"); +static BoolOption NoVerifyOption (false, 'X', "no-verify", IDS_HELPTEXT_NO_VERIFY); +static BoolOption NoVersionCheckOption (false, '\0', "no-version-check", IDS_HELPTEXT_NO_VERSION_CHECK); class GuiParseFeedback : public IniParseFeedback { diff --git a/install.cc b/install.cc index beb15c74..e58ef4b3 100644 --- a/install.cc +++ b/install.cc @@ -66,9 +66,7 @@ static long long int total_bytes = 0; static long long int total_bytes_sofar = 0; static int package_bytes = 0; -static BoolOption NoReplaceOnReboot (false, 'r', "no-replaceonreboot", - "Disable replacing in-use files on next " - "reboot."); +static BoolOption NoReplaceOnReboot (false, 'r', "no-replaceonreboot", IDS_HELPTEXT_NO_REPLACEONREBOOT); struct std_dirs_t { const char *name; diff --git a/io_stream_cygfile.cc b/io_stream_cygfile.cc index 52ef7355..7fa661c6 100644 --- a/io_stream_cygfile.cc +++ b/io_stream_cygfile.cc @@ -29,6 +29,7 @@ #include "io_stream_cygfile.h" #include "IOStreamProvider.h" #include "LogSingleton.h" +#include "resource.h" static StringChoiceOption::StringChoices algs({ {"xpress4k", FILE_PROVIDER_COMPRESSION_XPRESS4K}, @@ -38,8 +39,7 @@ static StringChoiceOption::StringChoices algs({ }); static StringChoiceOption CompactOsOption(algs, - '\0', "compact-os", - "Compress installed files with Compact OS (xpress4k, xpress8k, xpress16k, lzx)", + '\0', "compact-os", IDS_HELPTEXT_COMPACTOS, true, -1, FILE_PROVIDER_COMPRESSION_LZX); /* completely private iostream registration class */ diff --git a/libgetopt++/configure.ac b/libgetopt++/configure.ac index 45070264..b79691dc 100644 --- a/libgetopt++/configure.ac +++ b/libgetopt++/configure.ac @@ -10,7 +10,6 @@ AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE AC_CONFIG_HEADERS(include/autoconf.h) AC_PREFIX_DEFAULT(/usr/local) -AM_MAINTAINER_MODE m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES(yes)]) AC_LANG([C++]) diff --git a/libgetopt++/include/getopt++/BoolOption.h b/libgetopt++/include/getopt++/BoolOption.h index 8b20e1cc..7cfb8bf4 100644 --- a/libgetopt++/include/getopt++/BoolOption.h +++ b/libgetopt++/include/getopt++/BoolOption.h @@ -31,14 +31,14 @@ public: }; BoolOption(bool const defaultvalue, char shortopt, char const *longopt = 0, - std::string const &shorthelp = std::string(), + unsigned int shorthelp = 0, BoolOptionType type = BoolOptionType::simple, OptionSet &owner=GetOption::GetInstance()); virtual ~ BoolOption (); virtual std::string const shortOption () const; virtual std::string const longOption () const; virtual std::vector const & longOptionPrefixes () const; - virtual std::string const shortHelp () const; + virtual unsigned int shortHelp () const; virtual Result Process (char const *, int); virtual Argument argument () const; operator bool () const; @@ -48,7 +48,7 @@ private: bool _ovalue; char _shortopt; char const *_longopt; - std::string _shorthelp; + unsigned int _shorthelp; BoolOptionType _type; }; diff --git a/libgetopt++/include/getopt++/DefaultFormatter.h b/libgetopt++/include/getopt++/DefaultFormatter.h index 8b421a67..ee2397f5 100644 --- a/libgetopt++/include/getopt++/DefaultFormatter.h +++ b/libgetopt++/include/getopt++/DefaultFormatter.h @@ -31,18 +31,20 @@ class DefaultFormatter { const unsigned int h_len; const std::string s_lead; const std::string l_lead; + std::ostream &theStream; + StrLookup strLookup; public: - DefaultFormatter (std::ostream &aStream) + DefaultFormatter (std::ostream &aStream, StrLookup aLookup) : o_len(35), h_len(45), s_lead(" -"), l_lead(" --"), - theStream(aStream) + theStream(aStream), strLookup(aLookup) {} - DefaultFormatter (std::ostream &aStream, + DefaultFormatter (std::ostream &aStream, StrLookup aLookup, unsigned int o_len, unsigned int h_len, std::string s_lead, std::string l_lead) : o_len(o_len), h_len(h_len), s_lead(s_lead), l_lead(l_lead), - theStream(aStream) + theStream(aStream), strLookup(aLookup) {} void operator () (Option *anOption) { if (anOption->shortOption ()[0] == '\0') @@ -57,7 +59,7 @@ class DefaultFormatter { << std::string (o_len - s_lead.size () - 1 - l_lead.size () - longOption.size (), ' '); - std::string helpmsg = anOption->shortHelp(); + std::string helpmsg = strLookup(anOption->shortHelp()); while (helpmsg.size() > h_len) { // TODO: consider using a line breaking strategy here. @@ -68,7 +70,6 @@ class DefaultFormatter { } theStream << helpmsg << std::endl; } - std::ostream &theStream; }; #endif // _GETOPT___DEFAULTFORMATTER_H_ diff --git a/libgetopt++/include/getopt++/Option.h b/libgetopt++/include/getopt++/Option.h index b3b140ff..ae301813 100644 --- a/libgetopt++/include/getopt++/Option.h +++ b/libgetopt++/include/getopt++/Option.h @@ -34,7 +34,7 @@ public: virtual std::string const shortOption () const = 0; virtual std::string const longOption () const = 0; virtual std::vector const & longOptionPrefixes () const; - virtual std::string const shortHelp () const = 0; + virtual unsigned int shortHelp () const = 0; enum Result { Failed, Ok, diff --git a/libgetopt++/include/getopt++/OptionSet.h b/libgetopt++/include/getopt++/OptionSet.h index dbd8046b..b0c218cc 100644 --- a/libgetopt++/include/getopt++/OptionSet.h +++ b/libgetopt++/include/getopt++/OptionSet.h @@ -21,6 +21,8 @@ #include #include "getopt++/Option.h" +typedef const std::string (*StrLookup)(unsigned int); + class OptionSet { public: @@ -30,7 +32,7 @@ public: virtual bool Process (int argc, char **argv, Option *nonOptionHandler); virtual bool Process (std::vector const &parms, Option *nonOptionHandler); virtual bool process (Option *nonOptionHandler); - virtual void ParameterUsage (std::ostream &); + virtual void ParameterUsage (std::ostream &, StrLookup strLookup); virtual std::vector