summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-10-01 02:52:05 +0000
committerJim Meyering <jim@meyering.net>1994-10-01 02:52:05 +0000
commitec90359f3456b5256c45f6b17fc1a0e6964ed2f6 (patch)
tree491e6da32add2c396d783cb3b94e7342fe341c06
parentc8131583acd9716253b98a976c717df28c5a3874 (diff)
downloadcoreutils-ec90359f3456b5256c45f6b17fc1a0e6964ed2f6.tar.xz
.
-rw-r--r--src/basename.c3
-rw-r--r--src/date.c39
-rw-r--r--src/dirname.c3
-rw-r--r--src/echo.c3
-rw-r--r--src/env.c3
-rw-r--r--src/expr.c3
-rw-r--r--src/hostname.c3
-rw-r--r--src/id.c3
-rw-r--r--src/logname.c3
-rw-r--r--src/nice.c3
-rw-r--r--src/pathchk.c3
-rw-r--r--src/printenv.c3
-rw-r--r--src/printf.c3
-rw-r--r--src/pwd.c3
-rw-r--r--src/sleep.c3
-rw-r--r--src/stty.c3
-rw-r--r--src/su.c3
-rw-r--r--src/tee.c3
-rw-r--r--src/test.c3
-rw-r--r--src/tty.c3
-rw-r--r--src/uname.c3
-rw-r--r--src/who.c3
-rw-r--r--src/whoami.c3
-rw-r--r--src/yes.c5
24 files changed, 12 insertions, 98 deletions
diff --git a/src/basename.c b/src/basename.c
index 10726d225..1c8a058e2 100644
--- a/src/basename.c
+++ b/src/basename.c
@@ -25,10 +25,7 @@
basename functions.lisp p
=> functions.lis */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/date.c b/src/date.c
index fe129b9bb..da33d4169 100644
--- a/src/date.c
+++ b/src/date.c
@@ -13,36 +13,11 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Options:
- -d DATESTR Display the date DATESTR.
- -s DATESTR Set the date to DATESTR.
- -u Display or set the date in universal instead of local time.
- +FORMAT Specify custom date output format, described below.
- MMDDhhmm[[CC]YY][.ss] Set the date in the format described below.
-
- If one non-option argument is given, it is used as the date to which
- to set the system clock, and must have the format:
- MM month (01..12)
- DD day in month (01..31)
- hh hour (00..23)
- mm minute (00..59)
- CC first 2 digits of year (optional, defaults to current) (00..99)
- YY last 2 digits of year (optional, defaults to current) (00..99)
- ss second (00..61)
-
- If a non-option argument that starts with a `+' is specified, it
- is used to control the format in which the date is printed; it
- can contain any of the `%' substitutions allowed by the strftime
- function. A newline is always added at the end of the output.
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
David MacKenzie <djm@gnu.ai.mit.edu> */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
@@ -97,7 +72,11 @@ static struct option const long_options[] =
{NULL, 0, NULL, 0}
};
-/* FIXME: comment */
+/* Parse each line in INPUT_FILENAME as with --date and display the
+ each resulting time and date. If the file cannot be opened, tell why
+ then exit. Issue a diagnostic for any lines that cannot be parsed.
+ If any line cannot be parsed, return non-zero; otherwise return zero.
+ */
static int
batch_convert (const char *input_filename, const char *format)
@@ -144,7 +123,10 @@ batch_convert (const char *input_filename, const char *format)
error (0, 0, "invalid date `%s'", line);
status = 1;
}
- show_date (format, when);
+ else
+ {
+ show_date (format, when);
+ }
}
if (have_read_stdin && fclose (stdin) == EOF)
@@ -350,6 +332,7 @@ Usage: %s [OPTION]... [+FORMAT]\n\
printf ("\
\n\
-d, --date=STRING display time described by STRING, not `now'\n\
+ -f, --file=DATEFILE like --date once for each line of DATEFILE\n\
-s, --set=STRING set time described by STRING\n\
-u, --utc, --universal print or set Coordinated Universal Time\n\
--help display this help and exit\n\
diff --git a/src/dirname.c b/src/dirname.c
index 22e983dd2..3fb5c1a4a 100644
--- a/src/dirname.c
+++ b/src/dirname.c
@@ -17,10 +17,7 @@
/* Written by David MacKenzie and Jim Meyering. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/echo.c b/src/echo.c
index ea7510e63..ee2402a39 100644
--- a/src/echo.c
+++ b/src/echo.c
@@ -17,10 +17,7 @@ You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
#include "system.h"
diff --git a/src/env.c b/src/env.c
index 46a4071e8..19c2a62c1 100644
--- a/src/env.c
+++ b/src/env.c
@@ -77,10 +77,7 @@
{ LOGNAME=foo PATH=/energy }
*/
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
diff --git a/src/expr.c b/src/expr.c
index 7cf9110b3..e1ee8e722 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -28,10 +28,7 @@
Define EVAL_TRACE to print an evaluation trace. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
#include <regex.h>
diff --git a/src/hostname.c b/src/hostname.c
index 2a7939864..df533a57b 100644
--- a/src/hostname.c
+++ b/src/hostname.c
@@ -17,10 +17,7 @@
/* Jim Meyering <meyering@comco.com> */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/id.c b/src/id.c
index 706146661..92f2bd6c7 100644
--- a/src/id.c
+++ b/src/id.c
@@ -18,10 +18,7 @@
/* Written by Arnold Robbins, arnold@audiofax.com.
Major rewrite by David MacKenzie, djm@gnu.ai.mit.edu. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
diff --git a/src/logname.c b/src/logname.c
index bc21afcd4..7b152e5f2 100644
--- a/src/logname.c
+++ b/src/logname.c
@@ -15,10 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
#include <getopt.h>
diff --git a/src/nice.c b/src/nice.c
index 444131f7a..9f338662b 100644
--- a/src/nice.c
+++ b/src/nice.c
@@ -17,10 +17,7 @@
/* David MacKenzie <djm@gnu.ai.mit.edu> */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#define NDEBUG
diff --git a/src/pathchk.c b/src/pathchk.c
index 3b7c8e534..de8bc6c3f 100644
--- a/src/pathchk.c
+++ b/src/pathchk.c
@@ -38,10 +38,7 @@
David MacKenzie <djm@gnu.ai.mit.edu>
and Jim Meyering <meyering@cs.utexas.edu> */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
diff --git a/src/printenv.c b/src/printenv.c
index 4ddaeba8c..bbdca9d62 100644
--- a/src/printenv.c
+++ b/src/printenv.c
@@ -27,10 +27,7 @@
David MacKenzie and Richard Mlynarik */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
#include <getopt.h>
diff --git a/src/printf.c b/src/printf.c
index c4728114e..e437abe13 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -43,10 +43,7 @@
David MacKenzie <djm@gnu.ai.mit.edu> */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
#include <getopt.h>
diff --git a/src/pwd.c b/src/pwd.c
index 8da058a6b..807e77b74 100644
--- a/src/pwd.c
+++ b/src/pwd.c
@@ -17,10 +17,7 @@
/* Jim Meyering <meyering@comco.com> */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/sleep.c b/src/sleep.c
index dda1ea48a..f584f5cad 100644
--- a/src/sleep.c
+++ b/src/sleep.c
@@ -15,10 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
#include <getopt.h>
diff --git a/src/stty.c b/src/stty.c
index 5efeb243b..b98d1a9b8 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -27,10 +27,7 @@
David MacKenzie <djm@gnu.ai.mit.edu> */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
#include <termios.h>
diff --git a/src/su.c b/src/su.c
index e67d048e5..4a1640767 100644
--- a/src/su.c
+++ b/src/su.c
@@ -69,10 +69,7 @@
Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
diff --git a/src/tee.c b/src/tee.c
index ca1e27123..de0348b5d 100644
--- a/src/tee.c
+++ b/src/tee.c
@@ -17,10 +17,7 @@
/* Mike Parker, Richard M. Stallman, and David MacKenzie */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
diff --git a/src/test.c b/src/test.c
index 7aefb0a46..6830ca703 100644
--- a/src/test.c
+++ b/src/test.c
@@ -24,10 +24,7 @@
the shell builtin version. */
/* #define TEST_STANDALONE */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/tty.c b/src/tty.c
index 3d6c532be..f7ad301c0 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -22,10 +22,7 @@
Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
diff --git a/src/uname.c b/src/uname.c
index ae34b543c..39b170285 100644
--- a/src/uname.c
+++ b/src/uname.c
@@ -28,10 +28,7 @@
David MacKenzie <djm@gnu.ai.mit.edu> */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
#include <sys/utsname.h>
diff --git a/src/who.c b/src/who.c
index c173977c8..acfd1d097 100644
--- a/src/who.c
+++ b/src/who.c
@@ -32,10 +32,7 @@
-H Print column headings at top.
-w, -T -s plus mesg (+ or -, or ? if bad line). */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/whoami.c b/src/whoami.c
index 6bb43153f..233313ef6 100644
--- a/src/whoami.c
+++ b/src/whoami.c
@@ -18,10 +18,7 @@
/* Equivalent to `id -un'. */
/* Written by Richard Mlynarik. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
-
#include <stdio.h>
#include <sys/types.h>
#include <pwd.h>
diff --git a/src/yes.c b/src/yes.c
index 68bf9ae14..bb7539ba7 100644
--- a/src/yes.c
+++ b/src/yes.c
@@ -17,10 +17,7 @@
/* David MacKenzie <djm@gnu.ai.mit.edu> */
-#ifdef HAVE_CONFIG_H
-
-#endif
-
+#include <config.h>
#include <stdio.h>
#include <getopt.h>