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,
|
default=None,
|
||||||
help="dry run without writing"
|
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(
|
parser.add_argument(
|
||||||
"-v", dest="logging.level", action="append_const", const=-1, help="increase log level"
|
"-v", dest="logging.level", action="append_const", const=-1, help="increase log level"
|
||||||
)
|
)
|
||||||
@ -68,14 +76,6 @@ class AnsibleDoctor:
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--version", action="version", version="%(prog)s {}".format(__version__)
|
"--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__
|
return parser.parse_args().__dict__
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ class AnsibleDoctor:
|
|||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
self.log.sysexit_with_message("Can not set log level.\n{}".format(str(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:
|
if config.is_role:
|
||||||
self.logger.info("Ansible role detected")
|
self.logger.info("Ansible role detected")
|
||||||
else:
|
else:
|
||||||
|
@ -97,9 +97,9 @@ class Config():
|
|||||||
"file": True,
|
"file": True,
|
||||||
"type": environs.Env().list
|
"type": environs.Env().list
|
||||||
},
|
},
|
||||||
"no_role_detection": {
|
"role_detection": {
|
||||||
"default": False,
|
"default": True,
|
||||||
"env": "NO_ROLE_DETECTION",
|
"env": "ROLE_DETECTION",
|
||||||
"file": True,
|
"file": True,
|
||||||
"type": environs.Env().bool
|
"type": environs.Env().bool
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user