comparison moefetch.sh @ 174:0948e76a57a1

added help. Bump to 0.1-beta2
author edhoprima@gmail.com <edhoprima@gmail.com>
date Fri, 05 Jun 2009 20:23:55 +0000
parents 2b7c8c1ecdfe
children 5b7a154dbd21
comparison
equal deleted inserted replaced
173:2b7c8c1ecdfe 174:0948e76a57a1
38 38
39 # not user modifiable from here 39 # not user modifiable from here
40 40
41 # useless welcome message. Also version 41 # useless welcome message. Also version
42 Msg_Welcome() { 42 Msg_Welcome() {
43 MOEFETCHVERSION="0.1-beta" 43 MOEFETCHVERSION="0.1-beta2"
44 cat <<EOF 44 cat <<EOF
45 moefetch ${MOEFETCHVERSION} 45 moefetch ${MOEFETCHVERSION}
46 Copyright (c) 2009 edogawaconan <me@myconan.net> 46 Copyright (c) 2009 edogawaconan <me@myconan.net>
47 47
48 EOF 48 EOF
55 } 55 }
56 56
57 # help message 57 # help message
58 Err_Help() { 58 Err_Help() {
59 cat <<EOF 59 cat <<EOF
60 Usage: moefetch (quick)fetch|status <TAGS> 60 moefetch.sh COMMAND [-u SITE_URL] TAGS
61
62 COMMAND:
63 (quick)fetch: do a complete update. Add prefix quick to skip file checking
64 check: get list of new files, clean up local folder and print total new files
65
66 -u SITE_URL:
67 Specify URL of the Danbooru powered site you want to leech from. Default is ${DEFAULT_SITE}
68
69 TAGS:
70 Tags you want to download. Separated by spaces. Tag name follows standard Danbooru tagging scheme
71
61 EOF 72 EOF
62 exit 0 73 exit 0
63 } 74 }
64 75
65 # generate link by transforming xml 76 # generate link by transforming xml
226 ISQUICK= 237 ISQUICK=
227 ISNEW= 238 ISNEW=
228 239
229 [ $# -lt 2 ] && Err_Help 240 [ $# -lt 2 ] && Err_Help
230 case "$1" in 241 case "$1" in
231 status|fetch|quickfetch) 242 check|fetch|quickfetch)
232 echo "Starting..." 243 echo "Starting..."
233 JOB="$1" 244 JOB="$1"
234 ;; 245 ;;
235 *) 246 *)
236 Err_Help 247 Err_Help
261 Check_Folders 272 Check_Folders
262 273
263 274
264 # let's do the job! 275 # let's do the job!
265 case "${JOB}" in 276 case "${JOB}" in
266 status) 277 check)
267 Generate_Link 278 Generate_Link
268 Check_Files 279 Check_Files
269 ;; 280 ;;
270 fetch) 281 fetch)
271 Generate_Link 282 Generate_Link