Commit d56da2b
committed
dnf, yum: set global options before command
The `-y` and `-q` options are global options, and can be set before the
command that's run. There's some ambiguity in the USAGE output of different
versions (`yum`, `dnf`, `dnf5`)
yum always outputs the same usage, but shows that options go _before_
the command;
yum --help
Usage: yum [options] COMMAND
yum install --help
Usage: yum [options] COMMAND
dnf (dnf4) is ambiguous; when showing usage for `install` it shows the
options to be set _after_ the command;
dnf install --help
usage: dnf install [-c [config file]] [-q] [-v] [--version] ....
but the global `--help` shows them to be before the command;
dnf --help
usage: dnf [options] COMMAND
General DNF options:
...
-q, --quiet quiet operation
-v, --verbose verbose operation
,,,
--setopt SETOPTS set arbitrary config and repo options
dnf5 is more explicit about global vs per-command options;
dnf --help
Usage:
dnf5 [GLOBAL OPTIONS] <COMMAND> ...
dnf install --help
Usage:
dnf5 [GLOBAL OPTIONS] install [OPTIONS] [ARGUMENTS]
Testing shows that older versions (`dnf4` and `yum`) handle both fine,
and because `dnf5` (per the above) prefers global options to go before
the command, we can use that convention in this script.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>1 parent 0d6f72e commit d56da2b
2 files changed
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
| 557 | + | |
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
| 564 | + | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
| 581 | + | |
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
634 | | - | |
| 634 | + | |
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
0 commit comments