Shortcuts

Source code for mmagic.utils.cli

# Copyright (c) OpenMMLab. All rights reserved.
import re
import sys
import warnings


[docs]def modify_args(): """Modify args of argparse.ArgumentParser.""" for i, v in enumerate(sys.argv): if i == 0: assert v.endswith('.py') elif re.match(r'--\w+_.*', v): new_arg = v.replace('_', '-') warnings.warn( f'command line argument {v} is deprecated, ' f'please use {new_arg} instead.', category=DeprecationWarning, ) sys.argv[i] = new_arg
Read the Docs v: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.