]> git.proxmox.com Git - pve-zsync.git/commitdiff
do not duplicate common docs for CLI help and manpage
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 9 Mar 2018 15:55:42 +0000 (16:55 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 15 May 2018 11:33:05 +0000 (13:33 +0200)
add a hidden command which prints the POD of pve-zsync, reusing the
documentation for pve-zsync help CMD

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile
pve-zsync [changed mode: 0644->0755]

index 9879dc4543bbdae9df1d34997582e50f304aab3a..6317308a05951f02799512d96960dce3968878a7 100644 (file)
--- 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
old mode 100644 (file)
new mode 100755 (executable)
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 <<EOF;
 =head1 NAME
 
 pve-zsync - PVE ZFS Replication Manager
@@ -1280,117 +1284,21 @@ pve-zsync - PVE ZFS Replication Manager
 
 pve-zsync <COMMAND> [ARGS] [OPTIONS]
 
-pve-zsync help <cmd> [OPTIONS]
-
-       Get help about specified command.
-
-        <cmd>      string
-
-               Command name
-
-       -verbose   boolean
-
-               Verbose output format.
-
-pve-zsync create -dest <string> -source <string> [OPTIONS]
-
-        Create a sync Job
-
-        -dest      string
-
-               the destination target is like [IP]:<Pool>[/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 <VMID> or [IP:]<ZFSPool>[/Path]
-
-pve-zsync destroy -source <string> [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  <VMID> or [IP:]<ZFSPool>[/Path]
-
-pve-zsync disable -source <string> [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  <VMID> or [IP:]<ZFSPool>[/Path]
-
-pve-zsync enable -source <string> [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  <VMID> or [IP:]<ZFSPool>[/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 <string> -source <string> [OPTIONS]
+$help_destroy
 
-       will sync one time
+$help_disable
 
-        -dest      string
+$help_enable
 
-               the destination target is like [IP:]<Pool>[/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 <VMID> or [IP:]<ZFSPool>[/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
 <http://www.gnu.org/licenses/>.
+
+EOF
+}