From: Thomas Lamprecht Date: Fri, 9 Mar 2018 15:55:42 +0000 (+0100) Subject: do not duplicate common docs for CLI help and manpage X-Git-Url: https://git.proxmox.com/?p=pve-zsync.git;a=commitdiff_plain;h=956c7885905b1eb1d07d8d3ec1b089ebfd79c5ea do not duplicate common docs for CLI help and manpage add a hidden command which prints the POD of pve-zsync, reusing the documentation for pve-zsync help CMD Signed-off-by: Thomas Lamprecht --- diff --git a/Makefile b/Makefile index 9879dc4..6317308 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ dinstall: deb gzip -n pve-zsync.8.man -c9 >$@ pve-zsync.8.man: pve-zsync - pod2man -c "Proxmox Documentation" -s 8 -r ${RELEASE} -n pve-zsync pve-zsync pve-zsync.8.man + ./pve-zsync printpod | pod2man -c "Proxmox Documentation" -s 8 -r ${RELEASE} -n pve-zsync - pve-zsync.8.man .PHONY: install install: pve-zsync.8.man pve-zsync.8.gz diff --git a/pve-zsync b/pve-zsync old mode 100644 new mode 100755 index e411dff..8b41912 --- a/pve-zsync +++ b/pve-zsync @@ -1025,7 +1025,9 @@ my $commands = {'destroy' => 1, 'status' => 1, 'help' => 1, 'enable' => 1, - 'disable' => 1}; + 'disable' => 1, + 'printpod' => 1, +}; if (!$command || !$commands->{$command}) { usage(); @@ -1248,6 +1250,8 @@ if ($command eq 'destroy') { check_target($param->{source}); disable_job($param); +} elsif ($command eq 'printpod') { + print_pod(); } sub usage { @@ -1270,8 +1274,8 @@ sub check_target { parse_target($target); } -__END__ - +sub print_pod { + print < [ARGS] [OPTIONS] -pve-zsync help [OPTIONS] - - Get help about specified command. - - string - - Command name - - -verbose boolean - - Verbose output format. - -pve-zsync create -dest -source [OPTIONS] - - Create a sync Job - - -dest string - - the destination target is like [IP]:[/Path] - - -limit integer - - max sync speed in kBytes/s, default unlimited - - -maxsnap string - - how much snapshots will be kept before get erased, default 1 - - -name string - - name of the sync job, if not set it is default - - -skip boolean - - if this flag is set it will skip the first sync - - -source string - - the source can be an or [IP:][/Path] - -pve-zsync destroy -source [OPTIONS] - - remove a sync Job from the scheduler - - -name string - - name of the sync job, if not set it is default - - -source string - - the source can be an or [IP:][/Path] - -pve-zsync disable -source [OPTIONS] +$help_help - pause a sync job - - -name string - - name of the sync job, if not set it is default - - -source string - - the source can be an or [IP:][/Path] - -pve-zsync enable -source [OPTIONS] - - enable a syncjob and reset error - - -name string - - name of the sync job, if not set it is default - - -source string - - the source can be an or [IP:][/Path] -pve-zsync list - - Get a List of all scheduled Sync Jobs - -pve-zsync status - - Get the status of all scheduled Sync Jobs +$help_create -pve-zsync sync -dest -source [OPTIONS] +$help_destroy - will sync one time +$help_disable - -dest string +$help_enable - the destination target is like [IP:][/Path] +$help_list - -limit integer +$help_status - max sync speed in kBytes/s, default unlimited - - -maxsnap integer - - how much snapshots will be kept before get erased, default 1 - - -name string - - name of the sync job, if not set it is default. - It is only necessary if scheduler allready contains this source. - - -source string - - the source can be an or [IP:][/Path] - - -verbose boolean - - print out the sync progress. +$help_sync =head1 DESCRIPTION @@ -1431,3 +1339,6 @@ Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . + +EOF +}