Skip to content

Commit

Permalink
Fixed bug when detecting unknown control flag: #1333
Browse files Browse the repository at this point in the history
  • Loading branch information
gfursin committed Oct 19, 2024
1 parent 100bc66 commit bc800cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions cm/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## V3.2.4
- CMX: improved logging
- CMX: improved error handling (show module path and line number)
- CMX: fixed bug when detecting unknown control flag

## V3.2.3
- added --new_branch to `cm pull repo` and `cm checkout repo`
Expand Down
12 changes: 9 additions & 3 deletions cm/cmind/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,11 +844,13 @@ def x(self, i, out = None):
'ignore_inheritance', 'log', 'logfile', 'raise', 'repro',
'f', 'time', 'profile']]

delayed_error = ''

if len(unknown_control_flags)>0:
unknown_control_flags_str = ','.join(unknown_control_flags)

print (f'Unknown control flag(s): {unknown_control_flags_str}')
print ('')
delayed_error = f'Unknown control flag(s): {unknown_control_flags_str}'

# Force print help
control['h'] = True

Expand Down Expand Up @@ -943,7 +945,11 @@ def x(self, i, out = None):
profile.enable()

r = self._x(i, control)


if delayed_error != '' and r['return'] == 0:
r['return'] = 1
r['error'] = delayed_error

if not self.logger == None:
self.log(f"x output: {r}", "debug")

Expand Down

0 comments on commit bc800cf

Please sign in to comment.