|
|
@ -78,11 +78,13 @@ def run(argv=None):
|
|
|
|
description=APP_DESCRIPTION)
|
|
|
|
description=APP_DESCRIPTION)
|
|
|
|
parser.add_argument('files', metavar='FILE_OR_DIR', nargs='+',
|
|
|
|
parser.add_argument('files', metavar='FILE_OR_DIR', nargs='+',
|
|
|
|
help='files to check')
|
|
|
|
help='files to check')
|
|
|
|
parser.add_argument('-c', '--config-file', dest='config_file',
|
|
|
|
config_group = parser.add_mutually_exclusive_group()
|
|
|
|
action='store', help='path to a custom configuration')
|
|
|
|
config_group.add_argument('-c', '--config-file', dest='config_file',
|
|
|
|
parser.add_argument('-d', '--config-data', dest='config_data',
|
|
|
|
action='store',
|
|
|
|
action='store',
|
|
|
|
help='path to a custom configuration')
|
|
|
|
help='custom configuration (as YAML source)')
|
|
|
|
config_group.add_argument('-d', '--config-data', dest='config_data',
|
|
|
|
|
|
|
|
action='store',
|
|
|
|
|
|
|
|
help='custom configuration (as YAML source)')
|
|
|
|
parser.add_argument('-f', '--format',
|
|
|
|
parser.add_argument('-f', '--format',
|
|
|
|
choices=('parsable', 'standard'), default='standard',
|
|
|
|
choices=('parsable', 'standard'), default='standard',
|
|
|
|
help='format for parsing output')
|
|
|
|
help='format for parsing output')
|
|
|
@ -97,11 +99,6 @@ def run(argv=None):
|
|
|
|
|
|
|
|
|
|
|
|
args = parser.parse_args(argv)
|
|
|
|
args = parser.parse_args(argv)
|
|
|
|
|
|
|
|
|
|
|
|
if args.config_file is not None and args.config_data is not None:
|
|
|
|
|
|
|
|
print('Options --config-file and --config-data cannot be used '
|
|
|
|
|
|
|
|
'simultaneously.', file=sys.stderr)
|
|
|
|
|
|
|
|
sys.exit(-1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# User-global config is supposed to be in ~/.config/yamllint/config
|
|
|
|
# User-global config is supposed to be in ~/.config/yamllint/config
|
|
|
|
if 'XDG_CONFIG_HOME' in os.environ:
|
|
|
|
if 'XDG_CONFIG_HOME' in os.environ:
|
|
|
|
user_global_config = os.path.join(
|
|
|
|
user_global_config = os.path.join(
|
|
|
|