-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Problem
The xec command currently exits with code 0 when run without arguments, showing help/usage information. This violates Unix conventions where commands should exit with code 1 when displaying usage due to missing required arguments.
Current Behavior
$ xec
Ecstasy runner:
Executes an Ecstasy module, compiling it first if necessary.
Usage:
xec <options> <modulename>
# ... help text ...
$ echo $?
0Expected Unix Standard Behavior
Commands should exit with code 1 when they cannot perform their primary function due to missing required arguments, even when displaying helpful usage information.
Impact on Homebrew Integration
This non-standard behavior required a workaround in our Homebrew formula test. The test template in .github/actions/update-homebrew-tap/action.yml had to be modified to expect exit code 0 instead of the standard exit code 1:
test do
# TODO: The exit code test is technically correct to check for 1, but xec doesn't follow the accepted standard
output = shell_output("#{bin}/xec 2>&1")
assert_match "Ecstasy runner", output
endRecommendation
Update xec to exit with code 1 when no module is provided, maintaining Unix standard compliance while still providing helpful usage information.