summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--doc/idutils.texi20
-rw-r--r--libidu/scanners.c4
-rwxr-xr-xtestsuite/mkid-langopt3
4 files changed, 23 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index 3c5bcc0..c08f540 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,10 @@ GNU idutils NEWS -*- outline -*-
process only the files named in FILE. FILE must contain a list of
NUL-terminated file names.
+** Bug fixes
+
+ mkid and xtokid now can receive language specific options from
+ command line. Such options must be single-quoted.
* Noteworthy changes in release 4.3.92 (2008-10-18) [beta]
diff --git a/doc/idutils.texi b/doc/idutils.texi
index ab9040e..7421ac0 100644
--- a/doc/idutils.texi
+++ b/doc/idutils.texi
@@ -407,13 +407,21 @@ be specified on the command line for a single run.
@cindex language-specific option
Language-specific scanners also accept options. @var{Language} denotes
-the desired scanner, and @var{option} are the command-line options that
-should be passed through to it. For example, to pass the @var{-x
+the desired scanner, and @var{option} is the command-line option that
+should be passed through to it. For example, to pass the @var{-x foo
--coke-bottle} options to the scanner for the language @var{swizzle},
-pass this: @var{-l swizzle:"-x --coke-bottle"}, or this:
-@var{-lang-option=swizzle:"-x --coke-bottle"}, or this: @var{-l
-swizzle-x -l swizzle:--coke-bottle}. Use the @samp{--help} option to
-see the command-line option summary for
+use one of the next two forms, or a mixture of both:
+
+@example
+$ mkid -l swizzle:"-x foo" -l swizzle:--coke-bottle
+$ mkid --lang-option=swizzle:"-x foo" --lang-option=swizzle:--coke-bottle
+@end example
+
+Note the use of quotes when passing an option with arguments. Quoting is
+optional for options without arguments.
+
+Use the @samp{--help} option to see the command-line option summary for each
+language.
@end table
diff --git a/libidu/scanners.c b/libidu/scanners.c
index ec16501..19c8374 100644
--- a/libidu/scanners.c
+++ b/libidu/scanners.c
@@ -74,7 +74,7 @@ static struct token *get_token_lisp (FILE *in_FILE, void const *args, int *flags
static void *parse_args_lisp (char **argv, int argc);
static void help_me_lisp (void);
-static struct language const languages_0[] =
+static struct language languages_0[] =
{
{ "C", parse_args_c, get_token_c, help_me_c },
{ "C++", parse_args_c, get_token_c, help_me_cpp },
@@ -112,7 +112,7 @@ language_save_arg (char *arg)
}
if (lang->lg_argc == 0)
lang->lg_argv[lang->lg_argc++] = program_name;
- lang->lg_argv[lang->lg_argc++] = strsep (&arg, horizontal_space);
+ lang->lg_argv[lang->lg_argc++] = arg;
}
void
diff --git a/testsuite/mkid-langopt b/testsuite/mkid-langopt
new file mode 100755
index 0000000..957a0f0
--- /dev/null
+++ b/testsuite/mkid-langopt
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+../src/mkid --lang-opt=C:'-i $' -l C:'-k f' || exit 1