[@option{-}] [@option{--all}] [@option{--print-file-name}]
[@option{-T} @var{bfdname}] [@option{--target=}@var{bfdname}]
[@option{-w}] [@option{--include-all-whitespace}]
+ [@option{-s}] [@option{--output-separator}@var{sep_string}]
[@option{--help}] [@option{--version}] @var{file}@dots{}
@c man end
@end smallexample
are displayed, but other whitespace characters, such a newlines and
carriage returns, are not. The @option{-w} option changes this so
that all whitespace characters are considered to be part of a string.
+
+@item -s
+@itemx --output-separator
+By default, output strings are delimited by a new-line. This option
+allows you to supply any string to be used as the output record
+separator. Useful with --include-all-whitespace where strings
+may contain new-lines internally.
@end table
@c man end
-T {bfdname}
Specify a non-default object file format.
+ --output-separator=sep_string
+ -s sep_string String used to separate parsed strings in output.
+ Default is newline.
+
--help
-h Print the usage message on the standard output.
static char encoding;
static int encoding_bytes;
+/* Output string used to separate parsed strings */
+static char *output_separator;
+
static struct option long_options[] =
{
{"all", no_argument, NULL, 'a'},
{"include-all-whitespace", required_argument, NULL, 'w'},
{"encoding", required_argument, NULL, 'e'},
{"target", required_argument, NULL, 'T'},
+ {"output-separator", required_argument, NULL, 's'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'v'},
{NULL, 0, NULL, 0}
datasection_only = TRUE;
target = NULL;
encoding = 's';
+ output_separator = NULL;
- while ((optc = getopt_long (argc, argv, "adfhHn:wot:e:T:Vv0123456789",
+ while ((optc = getopt_long (argc, argv, "adfhHn:wot:e:T:s:Vv0123456789",
long_options, (int *) 0)) != EOF)
{
switch (optc)
encoding = optarg[0];
break;
+ case 's':
+ output_separator = optarg;
+ break;
+
case 'V':
case 'v':
print_version ("strings");
putchar (c);
}
- putchar ('\n');
+ if (output_separator)
+ fputs (output_separator, stdout);
+ else
+ putchar ('\n');
}
free (buf);
}
-T --target=<BFDNAME> Specify the binary file format\n\
-e --encoding={s,S,b,l,B,L} Select character size and endianness:\n\
s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n\
+ -s --output-separator=<string> String used to separate strings in output.\n\
@<file> Read options from <file>\n\
-h --help Display this information\n\
-v -V --version Print the program's version number\n"));