Package: gettext
Version: 0.17
Severity: minor

Hi,

I have the following C++ source file:

$ cat test.cc 
#include <iostream>

#define _(text) text

int main()
{
  std::cout << _("Hi, this is a string") << "\n";
  return 0;
}

The paramater handling of option -k causes some problems for me:

According to xgettext --help:

  -k, --keyword[=WORD]        additional keyword to be looked for (without
                              WORD means not to use default keywords) 


$ xgettext -k=_ -o test.po test.cc; cat test.po
cat: test.po: No such file or directory

Using 
$ xgettext --keyword=_ -o test.po test.cc
a proper PO file is created as "_" is recognized as keyword.

Now I wonder, does the short option -k accept parameters or not?
If not shouldn't it complain about "=_"?

I also tried
$ xgettext -k _ -o test.po test.cc; cat test.po
xgettext: xgettext cannot work without keywords to look for

I haven't looked at the source but I think GNU command line parsing
supports also options to short params. See e.g. the examples

     % testopt -c foo
     aflag = 0, bflag = 0, cvalue = foo
     
     % testopt -cfoo
     aflag = 0, bflag = 0, cvalue = foo

in
http://www.gnu.org/software/libtool/manual/libc/Example-of-Getopt.html#Example-of-Getopt

Yep, it is only a minor issue but it took me 5 minutes until I found that
I have to use the long form of the option. I played with --c++ and further
options first because I assumed another option was missing.

Jens



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to