1 |
Do not use parse_known_args to parse positional arguments, since that |
2 |
causes unknown options to be handled like unknown positional arguments. |
3 |
|
4 |
Bug: https://bugs.gentoo.org/673400 |
5 |
Signed-off-by: Zac Medico <zmedico@g.o> |
6 |
--- |
7 |
lib/_emerge/main.py | 9 ++++----- |
8 |
1 file changed, 4 insertions(+), 5 deletions(-) |
9 |
|
10 |
diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py |
11 |
index 486664c84..0d2c45a4f 100644 |
12 |
--- a/lib/_emerge/main.py |
13 |
+++ b/lib/_emerge/main.py |
14 |
@@ -299,7 +299,6 @@ def _find_bad_atoms(atoms, less_strict=False): |
15 |
def parse_opts(tmpcmdline, silent=False): |
16 |
myaction=None |
17 |
myopts = {} |
18 |
- myfiles=[] |
19 |
|
20 |
actions = frozenset([ |
21 |
"clean", "check-news", "config", "depclean", "help", |
22 |
@@ -810,9 +809,11 @@ def parse_opts(tmpcmdline, silent=False): |
23 |
parser.add_argument(dest=myopt.lstrip("--").replace("-", "_"), |
24 |
*args, **kwargs) |
25 |
|
26 |
+ parser.add_argument('positional_args', nargs='*') |
27 |
+ |
28 |
tmpcmdline = insert_optional_args(tmpcmdline) |
29 |
|
30 |
- myoptions, myargs = parser.parse_known_args(args=tmpcmdline) |
31 |
+ myoptions = parser.parse_args(args=tmpcmdline) |
32 |
|
33 |
if myoptions.alert in true_y: |
34 |
myoptions.alert = True |
35 |
@@ -1165,9 +1166,7 @@ def parse_opts(tmpcmdline, silent=False): |
36 |
if myaction is None and myoptions.deselect is True: |
37 |
myaction = 'deselect' |
38 |
|
39 |
- myfiles += myargs |
40 |
- |
41 |
- return myaction, myopts, myfiles |
42 |
+ return myaction, myopts, myoptions.positional_args |
43 |
|
44 |
def profile_check(trees, myaction): |
45 |
if myaction in ("help", "info", "search", "sync", "version"): |
46 |
-- |
47 |
2.21.0 |