bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27820: guix package -u: order of argument is significant


From: Hartmut Goebel
Subject: bug#27820: guix package -u: order of argument is significant
Date: Wed, 26 Jul 2017 10:28:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Am 25.07.2017 um 21:40 schrieb Mark H Weaver:
> That's because "--fallback" was treated as the argument to -u, i.e. the
> regexp specifying which packages to upgrade.  The few compiled packages
> were needed to run the profile hooks.

I'm astound about this. Python's argparse library is handling this as
the user expects:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--update', nargs='?', const=42)
parser.add_argument('--fallback', action="store_true")

print(parser.parse_args(['-u', '--fallback']))

print(parser.parse_args(['-u', 'xxx', '--fallback']))

prints

Namespace(fallback=True, update=None)
Namespace(fallback=True, update='xxx')

See https://docs.python.org/3/library/argparse.html#nargs

Isn't there a elaborated scheme/guile argparse library we can you? This
would/shouls/could also solve the issue that in guix we can not shortcut
options.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | address@hidden               |
| www.crazy-compilers.com | compilers which you thought are impossible |







reply via email to

[Prev in Thread] Current Thread [Next in Thread]