#!/bin/bash
# w4 - wget helper

set -e

source "/home/zwelch/src/mcf/mcsh-release/install/share/mcsh/mcsh.sh"

lib_load 'net/tool/wget'
lib_load 'doc/tool/wkhtmltopdf'
#lib_load 'doc/pdf'


######
# Mirroring CLI

w4_mirror() { cmd_dispatch "$@"; }
w4_mirror_usage() {
	cat <<EOF
<cmd> ...
Mirroring Commands:
	fetch <url>			Mirror a site, starting at url.
	convert <path>			Convert a site to PDF files.
EOF
}

w4_mirror_fetch() {
	min_args 1 "$@"
	local wget_prefix=${2:-/}
	local wget_host_dirs=false
	wget_mirror "$1"
}

w4_mirror_convert() {
	min_args 1 "$@"
	local -a file_find_opts=( -name '*.html' )
	local -a pdfs
	file_find pdfs "$@"
	html_to_pdf_wk "${pdfs[@]}"
}



######
# Main

w4_desc() { echo "wget helper"; }

w4_usage() {
	cat <<EOF
<cmd> ...
Web Download Command Groups:
	mirror ...			Mirroring commands
EOF
}

app_run "$@"

View the Developer Guide Index

View the Reference Manual Index


Generated on Wed Jun 28 07:39:28 PDT 2017 by mcsh d14 v0.20.0.