もっと自動生成
PEAR::Console_Getoptを利用して自動生成ツールを刷新。
コマンドラインオプションを用意してみた:
Usage: moony [options] <action_name> ... 'Foo' generates: - actions/Foo.php ......... the action class - templates/foo.php ....... the template file 'Foo_Bar' generates: - actions/Foo/Bar.php ..... the action class - templates/foo/bar.php ... the template file More than one action may be specified at once. Options: -d DIR, --dir=DIR root directory used when generating files -e, --entrypoint generate an entry point (index.php) -f, --force will overwrite newer files -h, --help show this help
"-d"オプションを使用することで自動生成時に基準となるディレクトリを指定できるようにしてみた。指定しない場合、カレントディレクトリが基準として使用される。