summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-08-14 13:18:40 +0100
committerLars Wirzenius <liw@liw.fi>2011-08-14 13:18:40 +0100
commitd389569d63300a1acc19c230f99333a03e0f9f5a (patch)
treee7426ff94463e12ed3667bd6174b239cf4451c81
parent3249182b41cf3cdf7e60aaf1d2c71d8e22d12396 (diff)
downloadextrautils-d389569d63300a1acc19c230f99333a03e0f9f5a.tar.gz
Add manpage for benchmark-cmd.
-rw-r--r--Makefile8
-rw-r--r--benchmark-cmd.1.in42
2 files changed, 49 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 01515ee..413a6e1 100644
--- a/Makefile
+++ b/Makefile
@@ -9,10 +9,15 @@ scripts = assert do-until errno minimify splitmboxdaily \
setuppy-debian-versions-match viewprof fix-shebang \
musictomp3 test-flacs unpack-debian-sources mksparse \
humanify benchmark-cmd
+manpagesin = $(shell ls *.1.in)
CFLAGS = -Wall -O2 --std=gnu99
-all: $(progs)
+all: $(progs) manpages
+
+manpages: $(manpagesin)
+ for x in $(manpagesin); do cmd=$$(basename $$x .1.in); \
+ ./$$cmd --generate-manpage=$$x > $$cmd.1; done
install: all
install -d $(DESTDIR)$(bindir)
@@ -22,3 +27,4 @@ install: all
clean:
rm -f $(progs) *.o
+ for x in $(manpagesin); do rm -f $$(basename $$x .in); done
diff --git a/benchmark-cmd.1.in b/benchmark-cmd.1.in
new file mode 100644
index 0000000..275dc0c
--- /dev/null
+++ b/benchmark-cmd.1.in
@@ -0,0 +1,42 @@
+.\" Copyright 2011 Lars Wirzenius <liw@liw.fi>
+.\"
+.\" This program 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 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+.\"
+.TH BENCHMARK-CMD 1
+.SH NAME
+benchmark-cmd \- benchmark shell commands
+.SH SYNOPSIS
+.SH DESCRIPTION
+.B benchmark-cmd
+benchmarks one or more Unix shell commands.
+It runs some setup commands,
+then the actual command,
+and then some cleanup commands,
+and can do this for several actual commands.
+It then reports the timing results for each actual command.
+.SH OPTIONS
+.SH EXAMPLE
+To see whether
+.BR ls (1)
+or
+.BR find (1)
+is faster:
+.IP
+.nf
+$ benchmark-cmd --command='ls -lAR $HOME' \\
+ --command='find $HOME -ls'
+real user system max RSS elapsed cmd
+ (s) (s) (s) (KiB) (s)
+ 0.4 1.0 1.4 8608 1.4 ls -lAR $HOME
+ 0.4 0.4 0.8 8400 0.8 find $HOME -ls