2 # drin - helper tools to initialize Drupal projects
4 # Copyright (C) 2017 Antonio Ospite <ao2@ao2.it>
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 PROGNAME=$(basename "$0")
26 usage: $PROGNAME [--help] [sub-command]
28 Helper tools to initialize Drupal projects.
31 -h, --help display this usage message and exit
36 for subcommand in ${LIBEXEC}/*.sh;
38 echo " $(basename "$subcommand" .sh)"
42 [ $# -eq 0 ] && { usage 1>&2 && exit 1; }
52 echo "Error: Unknown option '${1}'" 1>&2
55 subcommand="${LIBEXEC}/${1}.sh"
56 if [ ! -x "$subcommand" ]; then
57 echo "Error: '${1}' is not a known subcommand." 1>&2
58 echo "Run '${PROGNAME} --help' for a list of known subcommands." 1>&2
62 exec "$subcommand" "$@"