aboutsummaryrefslogtreecommitdiff
path: root/addts.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-07-31 15:43:43 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-07-31 15:47:22 +0300
commit492f8fabc828f286b3b6b12ed3396bde026c663a (patch)
tree8428e4636035def5eaa5cf4acde1bdd3937b17ff /addts.c
parenta954b80eb5f01bf96946c28a07b3648650bfae16 (diff)
downloadaddts-master.tar.gz
addts-master.tar.bz2
Version 1.0HEADv1.0master
Diffstat (limited to 'addts.c')
-rw-r--r--addts.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/addts.c b/addts.c
index 07fae4f..92f7e86 100644
--- a/addts.c
+++ b/addts.c
@@ -1,3 +1,19 @@
+/* This file is part of addts
+ * Copyright (C) 2018, 2019 Sergey Poznyakoff
+ *
+ * Addts is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * Addts is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with addts. If not, see <http://www.gnu.org/licenses/>.
+ */
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -50,6 +66,22 @@ alpha(int c)
return c == '\n' ? AEOL : ACHR;
}
+static void
+help(char *progname)
+{
+ printf("Usage: %s [OPTION]... [FILE]\n", progname);
+ puts("add timestamps at the beginning of each line\n");
+ puts(" -a append to FILE, instead of overwriting it");
+ puts(" -f FORMAT strftime(3) format for timestamps");
+ puts(" -s add timestamp to the end of each line");
+ puts(" -u report times in UTC");
+ puts(" -w CHR replace CHR with a horizontal space in FORMAT");
+ putchar('\n');
+ printf("Default FORMAT is \"%s\"\n", default_fmt);
+ putchar('\n');
+ puts("Report bugs to <gray@gnu.org>");
+}
+
int
main(int argc, char **argv)
{
@@ -85,8 +117,7 @@ main(int argc, char **argv)
break;
default:
if (optopt == 0) {
- printf("usage: %s [-asu] [-f FMT] [OUT-FILE]\n",
- argv[0]);
+ help(argv[0]);
return 0;
}
return 1;

Return to:

Send suggestions and report system problems to the System administrator.