Browse Source

style of code

develop
Simon Vieille 5 months ago
parent
commit
5d4ae9ade2
Signed by: Simon Vieille <simon@deblan.fr> GPG Key ID: 03383D15A1D31745
1 changed files with 19 additions and 12 deletions
  1. 19
    12
      bin/vacuum

+ 19
- 12
bin/vacuum View File

@@ -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

Loading…
Cancel
Save