Skip to content

Commit

Permalink
Move -y option out of parent options (#936)
Browse files Browse the repository at this point in the history
The -y option was being registered under the parent options (as if not
related to subcommands) but it is more appropriate to have it under the
subcommand options.
  • Loading branch information
bocekm authored Sep 26, 2023
1 parent aeca505 commit 594da2b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
10 changes: 5 additions & 5 deletions convert2rhel/toolopts.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ def _register_parent_options(parser):
action="store_true",
help="Print traceback in case of an abnormal exit and messages that could help find an issue.",
)
parser.add_argument(
"-y",
help="Answer yes to all yes/no questions the tool asks.",
action="store_true",
)

def _register_options(self):
"""Prescribe what command line options the tool accepts."""
Expand Down Expand Up @@ -217,6 +212,11 @@ def _register_options(self):
" It has no effect when used with the 'analyze' subcommand.",
action="store_true",
)
self._shared_options_parser.add_argument(
"-y",
help="Answer yes to all yes/no questions the tool asks.",
action="store_true",
)

self._add_subscription_manager_options()
self._add_alternative_installation_options()
Expand Down
2 changes: 1 addition & 1 deletion man/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_parser():
Generate the manpage locally by running the following in the root of the git repo:
$ sudo dnf install -y argparse-manpage
$ python -c 'from convert2rhel import toolopts; print("[synopsis]\n."+toolopts.CLI.usage())' > man/synopsis
$ PYTHONPATH=$PYTHONPATH:`pwd` argparse-manpage --pyfile man/__init__.py --function get_parser --manual-title="General Commands Manual" --description="Automates the conversion of Red Hat Enterprise Linux derivative distributions to Red Hat Enterprise Linux." --project-name "convert2rhel <ver>" --prog="convert2rhel" --include man/synopsis > man/convert2rhel.8
$ PYTHONPATH=. argparse-manpage --pyfile man/__init__.py --function get_parser --manual-title="General Commands Manual" --description="Automates the conversion of Red Hat Enterprise Linux derivative distributions to Red Hat Enterprise Linux." --project-name "convert2rhel <ver>" --prog="convert2rhel" --include man/distribution --include man/synopsis > man/convert2rhel.8
"""
parser = toolopts.CLI()._parser

Expand Down
22 changes: 9 additions & 13 deletions man/convert2rhel.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH CONVERT2RHEL "1" "2023\-09\-19" "convert2rhel 1.5.0" "General Commands Manual"
.TH CONVERT2RHEL "1" "2023\-09\-26" "convert2rhel 1.5.0" "General Commands Manual"
.SH NAME
convert2rhel \- Automates the conversion of Red Hat Enterprise Linux derivative distributions to Red Hat Enterprise Linux.
.SH SYNOPSIS
Expand All @@ -20,10 +20,6 @@ Show convert2rhel version and exit.
Print traceback in case of an abnormal exit and messages that could help find
an issue.

.TP
\fB\-y\fR
Answer yes to all yes/no questions the tool asks.

.SH
SUBCOMMANDS
.TP
Expand All @@ -50,10 +46,6 @@ Show convert2rhel version and exit.
Print traceback in case of an abnormal exit and messages that could help find
an issue.

.TP
\fB\-y\fR
Answer yes to all yes/no questions the tool asks.

.TP
\fB\-\-no\-rpm\-va\fR
Skip gathering changed rpm files using 'rpm \-Va'. By default it's performed
Expand All @@ -79,6 +71,10 @@ use this option multiple times. This option defaults to all repositories
Restart the system when it is successfully converted to RHEL to boot the new
RHEL kernel. It has no effect when used with the 'analyze' subcommand.

.TP
\fB\-y\fR
Answer yes to all yes/no questions the tool asks.

.SH SUBSCRIPTION MANAGER OPTIONS \fI\,'convert2rhel analyze'\/\fR
The following options are specific to using subscription\-manager.

Expand Down Expand Up @@ -187,10 +183,6 @@ Show convert2rhel version and exit.
Print traceback in case of an abnormal exit and messages that could help find
an issue.

.TP
\fB\-y\fR
Answer yes to all yes/no questions the tool asks.

.TP
\fB\-\-no\-rpm\-va\fR
Skip gathering changed rpm files using 'rpm \-Va'. By default it's performed
Expand All @@ -216,6 +208,10 @@ use this option multiple times. This option defaults to all repositories
Restart the system when it is successfully converted to RHEL to boot the new
RHEL kernel. It has no effect when used with the 'analyze' subcommand.

.TP
\fB\-y\fR
Answer yes to all yes/no questions the tool asks.

.SH SUBSCRIPTION MANAGER OPTIONS \fI\,'convert2rhel convert'\/\fR
The following options are specific to using subscription\-manager.

Expand Down

0 comments on commit 594da2b

Please sign in to comment.