mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
yat2m: New option --date.
* doc/yat2m.c (opt_date): new. (isodatestring): Use it if set. (main): New option --date.
This commit is contained in:
parent
686f31c3d5
commit
75eb071354
21
doc/yat2m.c
21
doc/yat2m.c
@ -1,5 +1,5 @@
|
|||||||
/* yat2m.c - Yet Another Texi 2 Man converter
|
/* yat2m.c - Yet Another Texi 2 Man converter
|
||||||
* Copyright (C) 2005, 2013 g10 Code GmbH
|
* Copyright (C) 2005, 2013, 2015 g10 Code GmbH
|
||||||
* Copyright (C) 2006, 2008, 2011 Free Software Foundation, Inc.
|
* Copyright (C) 2006, 2008, 2011 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -120,6 +120,7 @@ static int quiet;
|
|||||||
static int debug;
|
static int debug;
|
||||||
static const char *opt_source;
|
static const char *opt_source;
|
||||||
static const char *opt_release;
|
static const char *opt_release;
|
||||||
|
static const char *opt_date;
|
||||||
static const char *opt_select;
|
static const char *opt_select;
|
||||||
static const char *opt_include;
|
static const char *opt_include;
|
||||||
static int opt_store;
|
static int opt_store;
|
||||||
@ -323,8 +324,12 @@ isodatestring (void)
|
|||||||
{
|
{
|
||||||
static char buffer[11+5];
|
static char buffer[11+5];
|
||||||
struct tm *tp;
|
struct tm *tp;
|
||||||
time_t atime = time (NULL);
|
time_t atime;
|
||||||
|
|
||||||
|
if (opt_date && *opt_date)
|
||||||
|
atime = strtoul (opt_date, NULL, 10);
|
||||||
|
else
|
||||||
|
atime = time (NULL);
|
||||||
if (atime < 0)
|
if (atime < 0)
|
||||||
strcpy (buffer, "????" "-??" "-??");
|
strcpy (buffer, "????" "-??" "-??");
|
||||||
else
|
else
|
||||||
@ -1466,13 +1471,14 @@ main (int argc, char **argv)
|
|||||||
"Extract man pages from a Texinfo source.\n\n"
|
"Extract man pages from a Texinfo source.\n\n"
|
||||||
" --source NAME use NAME as source field\n"
|
" --source NAME use NAME as source field\n"
|
||||||
" --release STRING use STRING as the release field\n"
|
" --release STRING use STRING as the release field\n"
|
||||||
|
" --date EPOCH use EPOCH as publication date\n"
|
||||||
" --store write output using @manpage name\n"
|
" --store write output using @manpage name\n"
|
||||||
" --select NAME only output pages with @manpage NAME\n"
|
" --select NAME only output pages with @manpage NAME\n"
|
||||||
" --verbose enable extra informational output\n"
|
" --verbose enable extra informational output\n"
|
||||||
" --debug enable additional debug output\n"
|
" --debug enable additional debug output\n"
|
||||||
" --help display this help and exit\n"
|
" --help display this help and exit\n"
|
||||||
" -I DIR also search in include DIR\n"
|
" -I DIR also search in include DIR\n"
|
||||||
" -D gpgone the only useable define\n\n"
|
" -D gpgone the only usable define\n\n"
|
||||||
"With no FILE, or when FILE is -, read standard input.\n\n"
|
"With no FILE, or when FILE is -, read standard input.\n\n"
|
||||||
"Report bugs to <bugs@g10code.com>.");
|
"Report bugs to <bugs@g10code.com>.");
|
||||||
exit (0);
|
exit (0);
|
||||||
@ -1519,6 +1525,15 @@ main (int argc, char **argv)
|
|||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (!strcmp (*argv, "--date"))
|
||||||
|
{
|
||||||
|
argc--; argv++;
|
||||||
|
if (argc)
|
||||||
|
{
|
||||||
|
opt_date = *argv;
|
||||||
|
argc--; argv++;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (!strcmp (*argv, "--store"))
|
else if (!strcmp (*argv, "--store"))
|
||||||
{
|
{
|
||||||
opt_store = 1;
|
opt_store = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user