• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision6644df1129f8af3c78dd210008b30283e1759c09 (tree)
Zeit2005-01-25 21:47:11
Autorhenoheno <henoheno>
Commiterhenoheno

Log Message

Added untouch. Added warn() and err()

Ändern Zusammenfassung

Diff

--- a/tdiary-demogen.sh
+++ b/tdiary-demogen.sh
@@ -1,22 +1,28 @@
11 #!/bin/sh
2-# $Id: tdiary-demogen.sh,v 1.6 2005/01/16 03:26:14 henoheno Exp $
2+# $Id: tdiary-demogen.sh,v 1.7 2005/01/25 12:47:11 henoheno Exp $
33 #
44 # tDiary demonstration generator: generates many [theme].php
55 # License: GPL
66
7+warn(){ echo "$*" 1>&2; }
8+err(){ warn "$*"; exit 1; }
9+
710 usage(){
811 base="`basename $0`";
9- echo " $base [-d path/to/theme-directory] list"
10- echo " $base [-d path/to/theme-directory] interwiki"
11- echo " $base [-d path/to/theme-directory] touch"
12- echo " Command:"
13- echo " lis|list - List themes"
14- echo " int|interwiki - Publish interwiki definition and setting for each theme"
15- echo " tou|touch - Generate \$theme.php that includes index.php"
12+ warn " $base [-d path/to/theme-directory] list"
13+ warn " $base [-d path/to/theme-directory] interwiki"
14+ warn " $base [-d path/to/theme-directory] touch"
15+ warn " $base [-d path/to/theme-directory] untouch"
16+ warn " Command:"
17+ warn " lis|list - List themes"
18+ warn " int|interwiki - Publish interwiki definition and setting for each theme"
19+ warn " tou|touch - Generate \$theme.php that includes index.php"
20+ warn " unt|untouch - Remove \$theme.php(s) listed in theme directory"
21+ exit 1
1622 }
1723
1824 theme_list(){
19- cd "$dir" || echo "Error: directory '$dir' not found";
25+ cd "$dir" || err "Error: directory '$dir' not found"
2026 ls -1 | while read theme; do
2127 test -f "$theme/$theme.css" && echo "$theme"
2228 done
@@ -62,5 +68,19 @@ EOF
6268 fi
6369 done
6470 ;;
71+
72+unt|unto|untou|untouc|untouch )
73+ echo -n " Remove theme(s).php ? [y/N]: "
74+ read answer
75+ case "$answer" in
76+ [yY] | [yY][eE][sS] )
77+ theme_list | while read theme ; do
78+ test -f "$theme.php" && grep -q "define('TDIARY_THEME', '$theme');" "$theme.php" && rm -f "$theme.php"
79+ done
80+ ;;
81+ * )
82+ echo " Stopped."
83+ esac
84+ ;;
6585 esac
6686