Merge pull request #1372 from samrussell/dev

Add man pages for zstdgrep and zstdless
This commit is contained in:
Yann Collet 2018-10-16 10:09:33 -07:00 committed by GitHub
commit 374f2b4d03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 102 additions and 1 deletions

View File

@ -43,6 +43,12 @@ IF (UNIX)
ADD_CUSTOM_TARGET(zstd.1 ALL
${CMAKE_COMMAND} -E copy ${PROGRAMS_DIR}/zstd.1 .
COMMENT "Copying manpage zstd.1")
ADD_CUSTOM_TARGET(zstdgrep.1 ALL
${CMAKE_COMMAND} -E copy ${PROGRAMS_DIR}/zstdgrep.1 .
COMMENT "Copying manpage zstdgrep.1")
ADD_CUSTOM_TARGET(zstdless.1 ALL
${CMAKE_COMMAND} -E copy ${PROGRAMS_DIR}/zstdless.1 .
COMMENT "Copying manpage zstdless.1")
ADD_CUSTOM_TARGET(zstdcat.1 ALL ${CMAKE_COMMAND} -E create_symlink zstd.1 zstdcat.1 DEPENDS zstd.1 COMMENT "Creating zstdcat.1 symlink")
ADD_CUSTOM_TARGET(unzstd.1 ALL ${CMAKE_COMMAND} -E create_symlink zstd.1 unzstd.1 DEPENDS zstd.1 COMMENT "Creating unzstd.1 symlink")
@ -55,6 +61,8 @@ IF (UNIX)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zstd.1 DESTINATION "${MAN_INSTALL_DIR}")
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zstdcat.1 DESTINATION "${MAN_INSTALL_DIR}")
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/unzstd.1 DESTINATION "${MAN_INSTALL_DIR}")
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zstdgrep.1 DESTINATION "${MAN_INSTALL_DIR}")
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zstdless.1 DESTINATION "${MAN_INSTALL_DIR}")
ADD_EXECUTABLE(zstd-frugal ${PROGRAMS_DIR}/zstdcli.c ${PROGRAMS_DIR}/fileio.c)
TARGET_LINK_LIBRARIES(zstd-frugal libzstd_static)

View File

@ -249,16 +249,26 @@ MD2ROFF_FLAGS = --roff --warnings --manual="User Commands" --organization="zstd
zstd.1: zstd.1.md ../lib/zstd.h
cat $< | $(MD2ROFF) $(MD2ROFF_FLAGS) | sed -n '/^\.\\\".*/!p' > $@
zstdgrep.1: zstdgrep.1.md ../lib/zstd.h
cat $< | $(MD2ROFF) $(MD2ROFF_FLAGS) | sed -n '/^\.\\\".*/!p' > $@
zstdless.1: zstdless.1.md ../lib/zstd.h
cat $< | $(MD2ROFF) $(MD2ROFF_FLAGS) | sed -n '/^\.\\\".*/!p' > $@
.PHONY: man
man: zstd.1
man: zstd.1 zstdgrep.1 zstdless.1
.PHONY: clean-man
clean-man:
rm zstd.1
rm zstdgrep.1
rm zstdless.1
.PHONY: preview-man
preview-man: clean-man man
man ./zstd.1
man ./zstdgrep.1
man ./zstdless.1
#-----------------------------------------------------------------------------
# make install is validated only for Linux, macOS, BSD, Hurd and Solaris targets
@ -332,6 +342,8 @@ install: zstd
@$(INSTALL_MAN) zstd.1 $(DESTDIR)$(MAN1DIR)/zstd.1
@ln -sf zstd.1 $(DESTDIR)$(MAN1DIR)/zstdcat.1
@ln -sf zstd.1 $(DESTDIR)$(MAN1DIR)/unzstd.1
@$(INSTALL_MAN) zstdgrep.1 $(DESTDIR)$(MAN1DIR)/zstdgrep.1
@$(INSTALL_MAN) zstdless.1 $(DESTDIR)$(MAN1DIR)/zstdless.1
@echo zstd installation completed
.PHONY: uninstall
@ -341,6 +353,8 @@ uninstall:
@$(RM) $(DESTDIR)$(BINDIR)/zstdcat
@$(RM) $(DESTDIR)$(BINDIR)/unzstd
@$(RM) $(DESTDIR)$(BINDIR)/zstd
@$(RM) $(DESTDIR)$(MAN1DIR)/zstdless.1
@$(RM) $(DESTDIR)$(MAN1DIR)/zstdgrep.1
@$(RM) $(DESTDIR)$(MAN1DIR)/zstdcat.1
@$(RM) $(DESTDIR)$(MAN1DIR)/unzstd.1
@$(RM) $(DESTDIR)$(MAN1DIR)/zstd.1

23
programs/zstdgrep.1 Normal file
View File

@ -0,0 +1,23 @@
.
.TH "ZSTDGREP" "1" "October 2018" "zstd 1.3.7" "User Commands"
.
.SH "NAME"
\fBzstdgrep\fR \- print lines matching a pattern in zstandard\-compressed files
.
.SH "SYNOPSIS"
\fBzstdgrep\fR [\fIgrep\-flags\fR] [\-\-] \fIpattern\fR [\fIfiles\fR \.\.\.]
.
.SH "DESCRIPTION"
\fBzstdgrep\fR runs \fBgrep (1)\fR on files or stdin, if no files argument is given, after decompressing them with \fBzstdcat (1)\fR\.
.
.P
The grep\-flags and pattern arguments are passed on to \fBgrep (1)\fR\. If an \fB\-e\fR flag is found in the \fBgrep\-flags\fR, \fBzstdgrep\fR will not look for a pattern argument\.
.
.SH "EXIT STATUS"
In case of missing arguments or missing pattern, 1 will be returned, otherwise 0\.
.
.SH "SEE ALSO"
\fBzstd (1)\fR
.
.SH "AUTHORS"
Thomas Klausner \fIwiz@NetBSD\.org\fR

26
programs/zstdgrep.1.md Normal file
View File

@ -0,0 +1,26 @@
zstdgrep(1) -- print lines matching a pattern in zstandard-compressed files
============================================================================
SYNOPSIS
--------
`zstdgrep` [*grep-flags*] [--] _pattern_ [_files_ ...]
DESCRIPTION
-----------
`zstdgrep` runs `grep (1)` on files or stdin, if no files argument is given, after decompressing them with `zstdcat (1)`.
The grep-flags and pattern arguments are passed on to `grep (1)`. If an `-e` flag is found in the `grep-flags`, `zstdgrep` will not look for a pattern argument.
EXIT STATUS
-----------
In case of missing arguments or missing pattern, 1 will be returned, otherwise 0.
SEE ALSO
--------
`zstd (1)`
AUTHORS
-------
Thomas Klausner <wiz@NetBSD.org>

14
programs/zstdless.1 Normal file
View File

@ -0,0 +1,14 @@
.
.TH "ZSTDLESS" "1" "October 2018" "zstd 1.3.7" "User Commands"
.
.SH "NAME"
\fBzstdless\fR \- view zstandard\-compressed files
.
.SH "SYNOPSIS"
\fBzstdless\fR [\fIflags\fR] [\fIfile\fR \.\.\.]
.
.SH "DESCRIPTION"
\fBzstdless\fR runs \fBless (1)\fR on files or stdin, if no files argument is given, after decompressing them with \fBzstdcat (1)\fR\.
.
.SH "SEE ALSO"
\fBzstd (1)\fR

16
programs/zstdless.1.md Normal file
View File

@ -0,0 +1,16 @@
zstdless(1) -- view zstandard-compressed files
============================================================================
SYNOPSIS
--------
`zstdless` [*flags*] [_file_ ...]
DESCRIPTION
-----------
`zstdless` runs `less (1)` on files or stdin, if no files argument is given, after decompressing them with `zstdcat (1)`.
SEE ALSO
--------
`zstd (1)`