Problem
The main() function (line 3002-3005) always exits with code 0, regardless of whether the command succeeded or failed:
def main():
parser = build_parser()
args = parser.parse_args()
args.func(args) # No return value checked, no sys.exit()
All cmd_* functions print error messages but return None. This means:
tmx login --email wrong@example.com && echo "Login successful!"
# Prints "❌ Login fehlgeschlagen" AND "Login successful!" — exit code is always 0
This breaks shell scripting, CI/CD pipelines, and AI-agent tool use where the exit code determines success/failure.
Proposed Fix
Have cmd_* functions return a boolean or use sys.exit(1) on errors:
def main():
parser = build_parser()
args = parser.parse_args()
result = args.func(args)
if result is False:
sys.exit(1)
Then update each cmd_* function to return False on error paths (where they currently just print("❌ ...") and return).
Impact
- Severity: MEDIUM (affects scripting and programmatic use)
- Effort: Low (add
return False to error paths in each cmd function)
Problem
The
main()function (line 3002-3005) always exits with code 0, regardless of whether the command succeeded or failed:All
cmd_*functions print error messages but returnNone. This means:This breaks shell scripting, CI/CD pipelines, and AI-agent tool use where the exit code determines success/failure.
Proposed Fix
Have
cmd_*functions return a boolean or usesys.exit(1)on errors:Then update each
cmd_*function toreturn Falseon error paths (where they currently justprint("❌ ...")and return).Impact
return Falseto error paths in each cmd function)