[CRIU] [PATCH] crit: added crit manpage

Kir Kolyshkin kir at virtuozzo.com
Tue Nov 22 13:52:10 PST 2016


Looks good to me, thanks, Adrian!

As for the duplicating rules in Makefile, there is probably a way to 
workaround it
using a Makefile variable for man section number, but IMHO it doesn't 
worth the hassle,
I'm not sure the resulting Makefile will be cleaner.

Acked-by: Kir Kolyshkin <kir at openvz.org>


On 11/15/2016 05:50 AM, Adrian Reber wrote:
> From: Adrian Reber <areber at redhat.com>
>
> Based on debian's manpage from Salvatore Bonaccorso:
>
> e708a3a Sync manpage for crit to include short explanation for new subcommands
> 7dd571a Fix position for optional arguments in crit's manpage
> 017f8d9 Add minimal manpage for the crit
>
> Signed-off-by: Adrian Reber <areber at redhat.com>
> ---
>   Documentation/Makefile | 35 +++++++++++++++++++++++-------
>   Documentation/crit.txt | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 85 insertions(+), 8 deletions(-)
>   create mode 100644 Documentation/crit.txt
>
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 9668f42..de41b3b 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -7,16 +7,21 @@ A2X		:= a2x
>   XMLTO		:= xmlto
>   
>   FOOTER		:= footer.txt
> -SRC		+= criu.txt
> +SRC1		+= crit.txt
> +SRC8		+= criu.txt
> +SRC		:= $(SRC1) $(SRC8)
>   XMLS		:= $(patsubst %.txt,%.xml,$(SRC))
> -MANS		:= $(patsubst %.txt,%.8,$(SRC))
> +MAN1S		:= $(patsubst %.txt,%.1,$(SRC1))
> +MAN8S		:= $(patsubst %.txt,%.8,$(SRC8))
> +MANS		:= $(MAN1S) $(MAN8S)
> +MAN1DIR		:= $(MANDIR)/man1
>   MAN8DIR		:= $(MANDIR)/man8
>   
>   GROFF		:=groff
>   PAPER		:=$(shell paperconf 2>/dev/null || echo letter)
>   GROFF_OPTS	:= -Tps -t -dpaper=$(PAPER) -P-p$(PAPER) -man -msafer -rC1 -rD1 -rS11
> -PSS		:= $(MANS:%.8=%.ps)
> -PDFS		:= $(MANS:%.8=%.pdf)
> +PSS		:= $(patsubst %,%.ps,$(basename $(MANS)))
> +PDFS		:= $(patsubst %,%.pdf,$(basename $(MANS)))
>   
>   all: check $(MANS)
>   ps: $(PSS)
> @@ -38,11 +43,20 @@ $(FOOTER): ../Makefile.versions
>   	$(Q) echo ":man version:   $(CRIU_VERSION)"	>> $@
>   	$(Q) echo ":man manual:    CRIU Manual"		>> $@
>   
> +%.1: %.txt $(FOOTER) custom.xsl
> +	$(call msg-gen, $@)
> +	$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.1,%.xml,$@) $<
> +	$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.1,%.xml,$@) 2>/dev/null
> +
>   %.8: %.txt $(FOOTER) custom.xsl
>   	$(call msg-gen, $@)
>   	$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
>   	$(Q) $(XMLTO) man -m custom.xsl $(patsubst %.8,%.xml,$@) 2>/dev/null
>   
> +%.ps: %.1
> +	$(call msg-gen, $@)
> +	$(Q) $(GROFF) $(GROFF_OPTS) $^ > $@
> +
>   %.ps: %.8
>   	$(call msg-gen, $@)
>   	$(Q) $(GROFF) $(GROFF_OPTS) $^ > $@
> @@ -56,12 +70,17 @@ clean:
>   	$(Q) rm -f $(XMLS) $(MANS) $(PSS) $(PDFS) $(FOOTER)
>   
>   install: $(MANS)
> -	$(E) "  INSTALL " $(MANS)
> +	$(E) "  INSTALL " $(MAN8S)
>   	$(Q) mkdir -p $(DESTDIR)$(MAN8DIR)
> -	$(Q) install -m 644 $(MANS) $(DESTDIR)$(MAN8DIR)
> +	$(Q) install -m 644 $(MAN8S) $(DESTDIR)$(MAN8DIR)
> +	$(E) "  INSTALL " $(MAN1S)
> +	$(Q) mkdir -p $(DESTDIR)$(MAN1DIR)
> +	$(Q) install -m 644 $(MAN1S) $(DESTDIR)$(MAN1DIR)
>   
>   uninstall:
> -	$(E) " UNINSTALL" $(MANS)
> -	$(Q) $(RM) $(addprefix $(DESTDIR)$(MAN8DIR)/,$(MANS))
> +	$(E) " UNINSTALL" $(MAN1S)
> +	$(Q) $(RM) $(addprefix $(DESTDIR)$(MAN1DIR)/,$(MAN1S))
> +	$(E) " UNINSTALL" $(MAN8S)
> +	$(Q) $(RM) $(addprefix $(DESTDIR)$(MAN8DIR)/,$(MAN8S))
>   
>   .PHONY: clean install uninstall
> diff --git a/Documentation/crit.txt b/Documentation/crit.txt
> new file mode 100644
> index 0000000..32636c5
> --- /dev/null
> +++ b/Documentation/crit.txt
> @@ -0,0 +1,58 @@
> +CRIT(1)
> +=======
> +include::footer.txt[]
> +
> +NAME
> +----
> +crit - CRiu Image Tool
> +
> +SYNOPSIS
> +--------
> +*crit* 'decode' [-h] [-i IN] [-o OUT] [--pretty]
> +
> +*crit* 'encode' [-h] [-i IN] [-o OUT]
> +
> +*crit* 'info' [-h] in
> +
> +*crit* 'x' [-h] dir {ps,fds,mems}
> +
> +*crit* 'show' [-h] in
> +
> +DESCRIPTION
> +-----------
> +*crit* is a feature-rich replacement for existing *criu* show.
> +
> +ARGUMENTS
> +---------
> +
> +Positional Arguments
> +~~~~~~~~~~~~~~~~~~~~
> +
> +*decode*::
> +    convert *criu* image from binary type JSON
> +
> +*encode*::
> +    convert *criu* image from JSON type to binary
> +
> +*info*::
> +    show info about image
> +
> +*x*::
> +    explore image directory
> +
> +*show*::
> +    convert *criu* image from binary to human-readable JSON
> +
> +Optional Arguments
> +~~~~~~~~~~~~~~~~~~
> +
> +*-h*, *--help*::
> +    Print some help and exit
> +
> +SEE ALSO
> +--------
> +criu(8)
> +
> +AUTHOR
> +------
> +The CRIU team



More information about the CRIU mailing list