mirror of
https://github.com/thegeeklab/ansible-doctor.git
synced 2024-11-21 20:30:43 +00:00
adjust cli argument order
This commit is contained in:
parent
ee853ce8da
commit
4b28c6339f
@ -59,6 +59,14 @@ class AnsibleDoctor:
|
||||
default=None,
|
||||
help="dry run without writing"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-n",
|
||||
"--no-role-detection",
|
||||
dest="role_detection",
|
||||
action="store_false",
|
||||
default=None,
|
||||
help="disable automatic role detection"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-v", dest="logging.level", action="append_const", const=-1, help="increase log level"
|
||||
)
|
||||
@ -68,14 +76,6 @@ class AnsibleDoctor:
|
||||
parser.add_argument(
|
||||
"--version", action="version", version="%(prog)s {}".format(__version__)
|
||||
)
|
||||
parser.add_argument(
|
||||
"-n",
|
||||
"--no-role-detection",
|
||||
dest="no_role_detection",
|
||||
action="store_true",
|
||||
default=None,
|
||||
help="disable role detection"
|
||||
)
|
||||
|
||||
return parser.parse_args().__dict__
|
||||
|
||||
@ -90,7 +90,7 @@ class AnsibleDoctor:
|
||||
except ValueError as e:
|
||||
self.log.sysexit_with_message("Can not set log level.\n{}".format(str(e)))
|
||||
|
||||
if not config.config["no_role_detection"]:
|
||||
if config.config["role_detection"]:
|
||||
if config.is_role:
|
||||
self.logger.info("Ansible role detected")
|
||||
else:
|
||||
|
@ -97,9 +97,9 @@ class Config():
|
||||
"file": True,
|
||||
"type": environs.Env().list
|
||||
},
|
||||
"no_role_detection": {
|
||||
"default": False,
|
||||
"env": "NO_ROLE_DETECTION",
|
||||
"role_detection": {
|
||||
"default": True,
|
||||
"env": "ROLE_DETECTION",
|
||||
"file": True,
|
||||
"type": environs.Env().bool
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user