Skip to content

Correct getopts flags#198

Merged
AidanDelaney merged 2 commits intobuildpacks:mainfrom
gogolok:correct_base_images_build_sh
Feb 2, 2026
Merged

Correct getopts flags#198
AidanDelaney merged 2 commits intobuildpacks:mainfrom
gogolok:correct_base_images_build_sh

Conversation

@gogolok
Copy link
Contributor

@gogolok gogolok commented Jan 30, 2026

  • The option -v does not exist, but -f.

  • Prefix the option string with a leading colon so the 'actual' bad flag gets reported.

Before:

./build.sh: illegal option -- w
Invalid option: -
Usage:
  ./build.sh [-f <prefix>] [-p <platform>] <dir>
    -f    prefix to use for images      (default: cnbs/sample-base)
    -p    prefix to use for images      (default: linux/amd64)
   <dir>  directory to build

Now:

Invalid option: -w
Usage:
  ./build.sh [-f <prefix>] [-p <platform>] <dir>
    -f    prefix to use for images      (default: cnbs/sample-base)
    -p    prefix to use for images      (default: linux/amd64)
   <dir>  directory to build

@gogolok gogolok requested a review from a team as a code owner January 30, 2026 00:13
Copy link
Member

@AidanDelaney AidanDelaney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR enabled silent error handling in the getopts shell builtin. This seems reasonable in this context.

Signed-off-by: Robert Gogolok <gogolok@gmail.com>
@gogolok gogolok force-pushed the correct_base_images_build_sh branch from 7cad334 to 4a49686 Compare January 30, 2026 14:32
@AidanDelaney AidanDelaney merged commit fa282af into buildpacks:main Feb 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants