Skip to content

Commit

Permalink
- added -f to the CMX core to be backwards compatible with CM comma…
Browse files Browse the repository at this point in the history
…nds like `cm rm cache -f`
  • Loading branch information
gfursin committed Oct 13, 2024
1 parent ef53cd3 commit 554a70b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cm/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## V3.2.0.1
- added `-f` to the CMX core to be backwards compatible
with CM commands like `cm rm cache -f`

## V3.2.0
- added `utils.test_input` to test if input has keys
and report them as error
Expand Down
2 changes: 1 addition & 1 deletion cm/cmind/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Written by Grigori Fursin

__version__ = "3.2.0"
__version__ = "3.2.0.1"

from cmind.core import access
from cmind.core import x
Expand Down
9 changes: 8 additions & 1 deletion cm/cmind/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,10 +725,14 @@ def x(self, i, out = None):
control_flags[flag] = control[flag]

# Check if unknown flags
# f should be deprecated in the future - used for backwards
# compatibility with older commands like cm/cmx rm cache -f

unknown_control_flags = [flag for flag in control_flags if flag not in [
'h', 'help', 'version', 'out', 'j', 'json',
'save_to_json_file', 'save_to_yaml_file', 'common',
'ignore_inheritance', 'log', 'logfile', 'raise', 'repro']]
'ignore_inheritance', 'log', 'logfile', 'raise', 'repro',
'f']]

if len(unknown_control_flags)>0:
unknown_control_flags_str = ','.join(unknown_control_flags)
Expand All @@ -738,6 +742,9 @@ def x(self, i, out = None):
# Force print help
control['h'] = True

if control.pop('f', ''):
i['f'] = True

# Check repro
use_log = str(control_flags.pop('log', '')).strip().lower()
log_file = control_flags.pop('logfile', '')
Expand Down

0 comments on commit 554a70b

Please sign in to comment.