(doc0, doc1, initialize_argp_doc): Removed. Rely on the new argp method instead
This commit is contained in:
28
src/tar.c
28
src/tar.c
@@ -320,17 +320,16 @@ enum
|
|||||||
|
|
||||||
const char *argp_program_version = "tar (" PACKAGE_NAME ") " VERSION;
|
const char *argp_program_version = "tar (" PACKAGE_NAME ") " VERSION;
|
||||||
const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
|
const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
|
||||||
static char const doc0[] = N_("\
|
static char const doc[] = N_("\
|
||||||
GNU `tar' saves many files together into a single tape or disk archive, \
|
GNU `tar' saves many files together into a single tape or disk archive, \
|
||||||
and can restore individual files from the archive.\n\
|
and can restore individual files from the archive.\n\
|
||||||
\n\
|
\n\
|
||||||
Examples:\n\
|
Examples:\n\
|
||||||
tar -cf archive.tar foo bar # Create archive.tar from files foo and bar.\n\
|
tar -cf archive.tar foo bar # Create archive.tar from files foo and bar.\n\
|
||||||
tar -tvf archive.tar # List all files in archive.tar verbosely.\n\
|
tar -tvf archive.tar # List all files in archive.tar verbosely.\n\
|
||||||
tar -xf archive.tar # Extract all files from archive.tar.\n\
|
tar -xf archive.tar # Extract all files from archive.tar.\n")
|
||||||
");
|
"\v"
|
||||||
static char const doc1[] = N_("\
|
N_("The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n\
|
||||||
The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n\
|
|
||||||
The version control may be set with --backup or VERSION_CONTROL, values are:\n\n\
|
The version control may be set with --backup or VERSION_CONTROL, values are:\n\n\
|
||||||
none, off never make backups\n\
|
none, off never make backups\n\
|
||||||
t, numbered make numbered backups\n\
|
t, numbered make numbered backups\n\
|
||||||
@@ -1862,27 +1861,12 @@ static struct argp argp = {
|
|||||||
options,
|
options,
|
||||||
parse_opt,
|
parse_opt,
|
||||||
N_("[FILE]..."),
|
N_("[FILE]..."),
|
||||||
NULL,
|
doc,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Initialize the argp documentation. gettext 0.15 dislikes doc
|
|
||||||
strings containing '\v', so insert '\v' after translation. */
|
|
||||||
|
|
||||||
static void
|
|
||||||
initialize_argp_doc (void)
|
|
||||||
{
|
|
||||||
char const *xdoc0 = _(doc0); size_t xlen0 = strlen (xdoc0);
|
|
||||||
char const *xdoc1 = _(doc1); size_t xlen1 = strlen (xdoc1);
|
|
||||||
char *doc = xmalloc (xlen0 + 1 + xlen1 + 1);
|
|
||||||
memcpy (doc, xdoc0, xlen0);
|
|
||||||
doc[xlen0] = '\v';
|
|
||||||
memcpy (doc + xlen0 + 1, doc1, xlen1 + 1);;
|
|
||||||
argp.doc = doc;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
usage (int status)
|
usage (int status)
|
||||||
{
|
{
|
||||||
@@ -1939,8 +1923,6 @@ decode_options (int argc, char **argv)
|
|||||||
owner_option = -1;
|
owner_option = -1;
|
||||||
group_option = -1;
|
group_option = -1;
|
||||||
|
|
||||||
initialize_argp_doc ();
|
|
||||||
|
|
||||||
/* Convert old-style tar call by exploding option element and rearranging
|
/* Convert old-style tar call by exploding option element and rearranging
|
||||||
options accordingly. */
|
options accordingly. */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user