Skip to content

Commit

Permalink
add --help/--verbose long flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dzuelke committed Aug 30, 2014
1 parent fb3a1a7 commit 839d3d6
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 12 deletions.
21 changes: 18 additions & 3 deletions bin/heroku-hhvm-apache2
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ Options:
and should have a '<VirtualHost>' and likely also a
'<Directory>' section (see option -C above).
[default: \$COMPOSER_VENDOR_DIR/heroku/heroku-buildpack-php/conf/apache2/heroku.conf]
-h Display this help screen and exit.
-h, --help Display this help screen and exit.
-i <php.ini> The path to the php.ini file to use.
[default: \$COMPOSER_VENDOR_DIR/heroku/heroku-buildpack-php/conf/hhvm/php.ini]
-l <tailme.log> Path to additional log file to tail to STDERR so its
contents appear in 'heroku logs'. If the file does not
exist, it will be created. Wildcards are allowed, but
must be quoted and must match already existing files.
Note: this option can be repeated multiple times.
-v Be more verbose during startup.
-v, --verbose Be more verbose during startup.
All file paths must be relative to '$HEROKU_APP_DIR'.
Expand All @@ -91,11 +91,26 @@ export PORT=${PORT:-$(( $RANDOM+1024 ))}
# our standard logs
logs=( "/tmp/heroku.apache2_error.$PORT.log" "/tmp/heroku.apache2_access.$PORT.log" )

optstring=":C:c:i:l:vh"
optstring=":-:C:c:i:l:vh"

# process flags first
while getopts "$optstring" opt; do
case $opt in
-)
case "$OPTARG" in
verbose)
verbose=1
;;
help)
print_help 2>&1
exit
;;
*)
echo "Invalid option: --$OPTARG" >&2
exit
;;
esac
;;
v)
verbose=1
;;
Expand Down
21 changes: 18 additions & 3 deletions bin/heroku-hhvm-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ Options:
directives (globals are read from the system's default
Nginx configuration files).
[default: \$COMPOSER_VENDOR_DIR/heroku/heroku-buildpack-php/conf/nginx/heroku.conf.php]
-h Display this help screen and exit.
-h, --help Display this help screen and exit.
-i <php.ini> The path to the php.ini file to use.
[default: \$COMPOSER_VENDOR_DIR/heroku/heroku-buildpack-php/conf/hhvm/php.ini]
-l <tailme.log> Path to additional log file to tail to STDERR so its
contents appear in 'heroku logs'. If the file does not
exist, it will be created. Wildcards are allowed, but
must be quoted and must match already existing files.
Note: this option can be repeated multiple times.
-v Be more verbose during startup.
-v, --verbose Be more verbose during startup.
All file paths must be relative to '$HEROKU_APP_DIR'.
Expand All @@ -92,11 +92,26 @@ export PORT=${PORT:-$(( $RANDOM+1024 ))}
# our standard logs
logs=( "/tmp/heroku.nginx_access.$PORT.log" )

optstring=":C:c:i:l:vh"
optstring=":-:C:c:i:l:vh"

# process flags first
while getopts "$optstring" opt; do
case $opt in
-)
case "$OPTARG" in
verbose)
verbose=1
;;
help)
print_help 2>&1
exit
;;
*)
echo "Invalid option: --$OPTARG" >&2
exit
;;
esac
;;
v)
verbose=1
;;
Expand Down
21 changes: 18 additions & 3 deletions bin/heroku-php-apache2
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ Options:
unless you need to set global options.
-f <php-fpm.conf> The path to the full PHP-FPM configuration file.
[default: \$COMPOSER_VENDOR_DIR/heroku/heroku-buildpack-php/conf/php/php-fpm.conf]
-h Display this help screen and exit.
-h, --help Display this help screen and exit.
-i <php.ini> The path to the php.ini file to use.
[default: \$COMPOSER_VENDOR_DIR/heroku/heroku-buildpack-php/conf/php/php.ini]
-l <tailme.log> Path to additional log file to tail to STDERR so its
contents appear in 'heroku logs'. If the file does not
exist, it will be created. Wildcards are allowed, but
must be quoted and must match already existing files.
Note: this option can be repeated multiple times.
-v Be more verbose during startup.
-v, --verbose Be more verbose during startup.
All file paths must be relative to '$HEROKU_APP_DIR'.
Expand All @@ -98,11 +98,26 @@ export PORT=${PORT:-$(( $RANDOM+1024 ))}
# our standard logs
logs=( "/tmp/heroku.php-fpm.$PORT.log" "/tmp/heroku.apache2_error.$PORT.log" "/tmp/heroku.apache2_access.$PORT.log" )

optstring=":C:c:F:f:i:l:vh"
optstring=":-:C:c:F:f:i:l:vh"

# process flags first
while getopts "$optstring" opt; do
case $opt in
-)
case "$OPTARG" in
verbose)
verbose=1
;;
help)
print_help 2>&1
exit
;;
*)
echo "Invalid option: --$OPTARG" >&2
exit
;;
esac
;;
v)
verbose=1
;;
Expand Down
21 changes: 18 additions & 3 deletions bin/heroku-php-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ Options:
unless you need to set global options.
-f <php-fpm.conf> The path to the full PHP-FPM configuration file.
[default: \$COMPOSER_VENDOR_DIR/heroku/heroku-buildpack-php/conf/php/php-fpm.conf]
-h Display this help screen and exit.
-h, --help Display this help screen and exit.
-i <php.ini> The path to the php.ini file to use.
[default: \$COMPOSER_VENDOR_DIR/heroku/heroku-buildpack-php/conf/php/php.ini]
-l <tailme.log> Path to additional log file to tail to STDERR so its
contents appear in 'heroku logs'. If the file does not
exist, it will be created. Wildcards are allowed, but
must be quoted and must match already existing files.
Note: this option can be repeated multiple times.
-v Be more verbose during startup.
-v, --verbose Be more verbose during startup.
All file paths must be relative to '$HEROKU_APP_DIR'.
Expand All @@ -99,11 +99,26 @@ export PORT=${PORT:-$(( $RANDOM+1024 ))}
# our standard logs
logs=( "/tmp/heroku.php-fpm.$PORT.log" "/tmp/heroku.nginx_access.$PORT.log" )

optstring=":C:c:F:f:i:l:vh"
optstring=":-:C:c:F:f:i:l:vh"

# process flags first
while getopts "$optstring" opt; do
case $opt in
-)
case "$OPTARG" in
verbose)
verbose=1
;;
help)
print_help 2>&1
exit
;;
*)
echo "Invalid option: --$OPTARG" >&2
exit
;;
esac
;;
v)
verbose=1
;;
Expand Down

0 comments on commit 839d3d6

Please sign in to comment.