style of code
Este cometimento está contido em:
ascendente
1231c955b4
cometimento
5d4ae9ade2
31
bin/vacuum
31
bin/vacuum
|
@ -1,13 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
usage() {
|
||||
printf "Usage: %s [url] [filters] [-h|--help|--wget|--httrack]\n\n" "$0"
|
||||
cat << EOF
|
||||
Usage: $0 [url] [filters] [-h|--help|--wget|--httrack]
|
||||
|
||||
printf " --wget Select GNU Wget\n"
|
||||
printf " --httrack Select httrack to vacuum\n"
|
||||
printf " -h,--help Show this help\n\n"
|
||||
--wget Select GNU Wget
|
||||
--httrack Select httrack to vacuum
|
||||
-h,--help Show this help
|
||||
|
||||
printf "Filters only work with httrack. \`man httrack\` to get help.\n"
|
||||
Filters only work with httrack. \`man httrack\` to get help
|
||||
EOF
|
||||
}
|
||||
|
||||
for i in "$@"; do
|
||||
|
@ -34,8 +36,6 @@ fi
|
|||
|
||||
if [ -z "$TOOL" ]; then
|
||||
while test -z "$TOOL"; do
|
||||
printf ""
|
||||
|
||||
printf "Vacuum:\n"
|
||||
printf " [1] httrack\n"
|
||||
printf " [2] wget\n"
|
||||
|
@ -57,9 +57,16 @@ if [ -z "$TOOL" ]; then
|
|||
fi
|
||||
|
||||
if [ "$TOOL" = "httrack" ]; then
|
||||
printf "\nCommand:\n\n httrack %s\n\n" "$URL"
|
||||
httrack $URL
|
||||
elif [ "$TOOL" = "wget" ]; then
|
||||
printf "\nCommand:\n\n wget --progress=bar -E -r -k -np --no-check-certificate --user-agent=Firefox \"%s\"\n\n" "$URL"
|
||||
wget --progress=bar -E -r -k -np --no-check-certificate --user-agent=Firefox $URL
|
||||
COMMAND="httrack $URL"
|
||||
else
|
||||
COMMAND="wget --progress=bar -E -r -k -np --no-check-certificate --user-agent=Firefox $URL"
|
||||
fi
|
||||
|
||||
cat << EOF
|
||||
Command:
|
||||
|
||||
$COMMAND
|
||||
|
||||
EOF
|
||||
|
||||
exec $COMMAND
|
||||
|
|
Carregando…
Criar uma nova questão referindo esta