Add manpages for stopwatch, suptime and timestamp
This commit is contained in:
parent
cce6188649
commit
e5f8df45b4
44
Makefile
44
Makefile
|
@ -1,35 +1,45 @@
|
||||||
|
SRCDIR = src
|
||||||
|
DISTDIR = dist
|
||||||
|
DISTBIN = $(DISTDIR)/usr/bin
|
||||||
|
DISTMAN = $(DISTDIR)/usr/share/man
|
||||||
|
|
||||||
all: djl-utils.deb
|
all: djl-utils.deb
|
||||||
|
|
||||||
dist: bin DEBIAN.control
|
dist: bin DEBIAN.control
|
||||||
bin: line sign pasta suptime countdown stopwatch timestamp
|
bin: line sign pasta suptime countdown stopwatch timestamp
|
||||||
|
|
||||||
distdir:
|
distdir:
|
||||||
mkdir -p dist/usr/bin
|
mkdir -p $(DISTBIN)
|
||||||
|
mkdir -p $(DISTMAN)/man1
|
||||||
|
|
||||||
line: src/line.c distdir
|
line: $(SRCDIR)/line.c distdir
|
||||||
cc -o dist/usr/bin/line src/line.c
|
cc -o $(DISTBIN)/line $(SRCDIR)/line.c
|
||||||
|
|
||||||
sign: src/sign distdir
|
sign: $(SRCDIR)/sign distdir
|
||||||
cp src/sign dist/usr/bin
|
cp $(SRCDIR)/sign $(DISTBIN)/sign
|
||||||
|
|
||||||
pasta: src/pasta distdir
|
pasta: $(SRCDIR)/pasta distdir
|
||||||
cp src/pasta dist/usr/bin
|
cp $(SRCDIR)/pasta $(DISTBIN)/pasta
|
||||||
|
|
||||||
suptime: src/suptime.c distdir
|
suptime: $(SRCDIR)/suptime.c $(SRCDIR)/suptime.1 distdir
|
||||||
cc -o dist/usr/bin/suptime src/suptime.c
|
cc -o $(DISTBIN)/suptime $(SRCDIR)/suptime.c
|
||||||
|
cp $(SRCDIR)/suptime.1 $(DISTMAN)/man1/suptime.1
|
||||||
|
|
||||||
countdown: src/countdown.c distdir
|
countdown: $(SRCDIR)/countdown.c distdir
|
||||||
cc -o dist/usr/bin/countdown src/countdown.c
|
cc -o $(DISTBIN)/countdown $(SRCDIR)/countdown.c
|
||||||
|
|
||||||
stopwatch: src/stopwatch.c distdir
|
stopwatch: $(SRCDIR)/stopwatch.c $(SRCDIR)/stopwatch.1 distdir
|
||||||
cc -o dist/usr/bin/stopwatch src/stopwatch.c
|
cc -o $(DISTBIN)/stopwatch $(SRCDIR)/stopwatch.c
|
||||||
|
cp $(SRCDIR)/stopwatch.1 $(DISTMAN)/man1/stopwatch.1
|
||||||
|
|
||||||
timestamp: src/timestamp distdir
|
timestamp: $(SRCDIR)/timestamp $(SRCDIR)/timestamp.1 distdir
|
||||||
cp src/timestamp dist/usr/bin
|
cp $(SRCDIR)/timestamp $(DISTBIN)
|
||||||
|
cp $(SRCDIR)/timestamp.1 $(DISTMAN)/man1/timestamp.1
|
||||||
|
|
||||||
DEBIAN.control: src/DEBIAN/control distdir
|
|
||||||
|
DEBIAN.control: $(SRCDIR)/DEBIAN/control distdir
|
||||||
rm -rf dist/DEBIAN
|
rm -rf dist/DEBIAN
|
||||||
cp -r src/DEBIAN dist/DEBIAN
|
cp -r $(SRCDIR)/DEBIAN dist/DEBIAN
|
||||||
|
|
||||||
djl-utils.deb: dist
|
djl-utils.deb: dist
|
||||||
dpkg-deb -b dist
|
dpkg-deb -b dist
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
.TH STOPWATCH 1
|
||||||
|
.SH NAME
|
||||||
|
stopwatch \- start a stopwatch
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B stopwatch
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.B stopwatch
|
||||||
|
starts a stopwatch, counting up once every second.
|
||||||
|
To stop the stopwatch, press any key.
|
|
@ -0,0 +1,51 @@
|
||||||
|
.TH SUPTIME 1
|
||||||
|
|
||||||
|
.SH NAME
|
||||||
|
suptime \- Tell how long the system has been running.
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B suptime
|
||||||
|
[\fB\-s\fR]
|
||||||
|
[\fB\-m\fR]
|
||||||
|
[\fB\-H\fR]
|
||||||
|
[\fB\-d\fR]
|
||||||
|
[\fB\-h\fR]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.B suptime
|
||||||
|
outputs a single unit representation of system uptime.
|
||||||
|
By default outputs in seconds.
|
||||||
|
If multiple arguments are given, the last unit will be used.
|
||||||
|
.SH OPTIONS
|
||||||
|
.TP
|
||||||
|
.BR \-s
|
||||||
|
Output in seconds.
|
||||||
|
.TP
|
||||||
|
.BR \-m
|
||||||
|
Output in minutes.
|
||||||
|
.TP
|
||||||
|
.BR \-H
|
||||||
|
Output in hours.
|
||||||
|
.TP
|
||||||
|
.BR \-d
|
||||||
|
Output in days.
|
||||||
|
.TP
|
||||||
|
.BR \-h
|
||||||
|
Display help.
|
||||||
|
.SH EXAMPLES
|
||||||
|
To output system uptime in seconds
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
.RS
|
||||||
|
suptime
|
||||||
|
.RE
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
You can also include use the \fB\-s\fR option although it is not necessary to
|
||||||
|
output seconds.
|
||||||
|
.PP
|
||||||
|
To output system uptime in days
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
.RS
|
||||||
|
suptime -d
|
||||||
|
.RE
|
||||||
|
.fi
|
|
@ -0,0 +1,34 @@
|
||||||
|
.TH TIMESTAMP 1
|
||||||
|
.SH NAME
|
||||||
|
timestamp \- print the current datetime
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B timestamp
|
||||||
|
[\fB\-d\fR]
|
||||||
|
[\fB\-r\fR]
|
||||||
|
[\fB\-v\fR]
|
||||||
|
[\fB\-h\fR]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.B timestamp
|
||||||
|
prints the current datetime.
|
||||||
|
.SH OPTIONS
|
||||||
|
.TP
|
||||||
|
.BR \-d
|
||||||
|
Use %Y-%m-%d format.
|
||||||
|
.TP
|
||||||
|
.BR \-r
|
||||||
|
Use the RFC3339 timestamp format.
|
||||||
|
.TP
|
||||||
|
.BR \-v
|
||||||
|
Use %Y-%m-%d %T %Z format.
|
||||||
|
This is the default format if none are given.
|
||||||
|
.TP
|
||||||
|
.BR \-h
|
||||||
|
Display help
|
||||||
|
.SH EXAMPLES
|
||||||
|
To get the current datetime in RFC3339 format
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
.RS
|
||||||
|
timestamp -r
|
||||||
|
.RE
|
||||||
|
.fi
|
Loading…
Reference in New Issue