]> pd.if.org Git - zpackage/commitdiff
add quote and hash man pages
authorNathan Wagner <nw@hydaspes.if.org>
Sat, 8 Dec 2018 18:47:47 +0000 (18:47 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Sat, 8 Dec 2018 22:52:45 +0000 (22:52 +0000)
Makefile
doc/zpm-hash.8 [new file with mode: 0644]
doc/zpm-quote.8 [new file with mode: 0644]
doc/zpm.8

index 13b3d2b6188023aeb6e3fd559bdc24e8bb471d62..74579e1cd58d5f4102a0c912274147f3fac10d76 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ ZPKGBIN=zpm-addfile zpm-extract zpm-init zpm-vercmp zpm-stat zpm-hash \
 SCRIPTS=zpm zpm-install zpm-merge zpm-list zpm-preserve zpm-test zpm-log \
        zpm-contents zpm-uninstall zpm-pathmod zpm-rmpackage zpm-newpackage \
        zpm-pkg zpm-add zpm-pkgfile zpm-gc zpm-repo zpm-update zpm-confgit
-MANPAGES=$(addprefix doc/, zpm.8 zpm-list.8 zpm-contents.8)
+MANPAGES=$(addprefix doc/, zpm.8 zpm-list.8 zpm-contents.8 zpm-hash.8 zpm-quote.8)
 COMPILED=$(ZPKGBIN)
 PROGRAMS=$(SCRIPTS) $(COMPILED)
 
diff --git a/doc/zpm-hash.8 b/doc/zpm-hash.8
new file mode 100644 (file)
index 0000000..a77f957
--- /dev/null
@@ -0,0 +1,31 @@
+.TH zpm-hash 8 2018-12-08 "ZPM 0.3"
+.SH NAME
+zpm-hash \- list files in a zpm package
+.SH SYNOPSIS
+.B zpm hash
+[
+.I file
+]
+.SH DESCRIPTION
+\fBzpm-hash\fR hashes a file, or standard input if no file is given, and prints
+the hex encoded hash of the input to stdout, followed by a newline.
+The hash is the same hash used by zpm internally to track file content.
+The hash used is SHA-256.
+.SH OPTIONS
+None.
+.SH EXAMPLES
+.PP
+.nf
+cat /dev/null | zpm hash
+e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
+.fi
+.SH EXIT STATUS
+0 on success non zero on failure
+.SH FILES
+None
+.SH ENVIRONMENT
+None
+.SH AUTHOR
+Nathan Wagner
+.SH SEE ALSO
+zpm(8)
diff --git a/doc/zpm-quote.8 b/doc/zpm-quote.8
new file mode 100644 (file)
index 0000000..7c77eb0
--- /dev/null
@@ -0,0 +1,48 @@
+.TH zpm-quote 8 2018-12-08 "ZPM 0.3"
+.SH NAME
+zpm-quote \- list files in a zpm package
+.SH SYNOPSIS
+.B zpm quote
+[
+.B -qsi
+]
+[\fB-d \fIdelimiter\fR]
+.SH DESCRIPTION
+\fBzpm-quote\fR quotes its arguments so the result can
+be safely interpolated in sql statements or shell scripts.
+By default the arguments are quoted as a sql string literal.
+.SH OPTIONS
+.TP
+\-q
+add quotes around the result.
+.TP
+\-s
+quote for the shell instead of sql
+.TP
+\-i
+quote as an sql identifier
+.TP
+\-d \fIdelimiter\fR
+separate arguments with the given delimiter string.  If
+not specified, results are separated with a newline
+.SH EXAMPLES
+.Pp
+zpm quote foo -> foo
+.PP
+zpm quote -q foo -> 'foo' 
+.PP
+zpm quote -qi foo -> "foo"
+.PP
+zpm quote -q 'foo bar' -> 'foo bar'
+.PP
+zpm quote -qs "foo'bar" -> 'foo'\\''bar'
+.SH EXIT STATUS
+0 on success non zero on failure
+.SH FILES
+None
+.SH ENVIRONMENT
+None
+.SH AUTHOR
+Nathan Wagner
+.SH SEE ALSO
+zpm(8)
index 90e1f7ca2dd2b7d476a889a300857010d09d3b33..1ba988603937c0888709133fd4890e42e563ea3e 100644 (file)
--- a/doc/zpm.8
+++ b/doc/zpm.8
@@ -28,3 +28,5 @@ Nathan Wagner
 .BR zpm-list (8)
 .BR zpm-update (8)
 .BR zpm-repo (8)
+.BR zpm-quote (8)
+.BR zpm-hash (8)