Skip to content

linuxcnc_check_ini: make -e/--error work - #4622

Open
yurc wants to merge 2 commits into
LinuxCNC:masterfrom
SyncTwin:synctwin/check-ini-e-option
Open

yurc wants to merge 2 commits into
LinuxCNC:masterfrom
SyncTwin:synctwin/check-ini-e-option

Conversation

@yurc

@yurc yurc commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

The option loop in main() tests -h with a plain if after the -e branch, so -e/--error falls through to the else and the script exits with Unhandled option: '-e' (exit code 2). The fix is elif.

Reproduce:

linuxcnc_check_ini -e configs/sim/axis/axis_mm.ini

Before: Unhandled option: '-e', exit 2. After: the INI file is checked and warnings are treated as errors; -h still prints usage.

One-line change, src/emc/ini/linuxcnc_check_ini.py only.

yurc and others added 2 commits October 3, 2026 20:40
The option loop tested "-h" with a plain "if" after the "-e" branch, so
"-e" fell through to the "else" and the script exited with
"Unhandled option: '-e'" (exit code 2). Use "elif".

Reproduce: linuxcnc_check_ini -e any.ini
  before: Unhandled option: '-e'
  after:  the INI file is checked and warnings are treated as errors.
The INI file only produces a warning. Without -e the exit value must be
0; with -e or --error warnings are errors and the exit value must be 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZ9Cy18se5jq3dpFgTetJs
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.

3 participants