-
Notifications
You must be signed in to change notification settings - Fork 989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add shorthand syntax in cli to specify host and build in 1 argument #14727
Add shorthand syntax in cli to specify host and build in 1 argument #14727
Conversation
Can't find a way to still show the |
conan/cli/args.py
Outdated
parser.add_argument("-c{}".format(short_suffix), | ||
"--conf{}".format(long_suffix), | ||
class ContextAllAction(argparse.Action): | ||
def __init__(self, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably args/kwargs can be used to simplify code, both here and in super()
code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish the append Action was public in argparse, so this could be
class ContextAllAction(argparse._AppendAction):
def __call__(self, action_parser, namespace, values, option_string=None):
for context in contexts:
items = getattr(namespace, self.dest + "_" + context, None)
items = items[:] if items else []
items.append(values)
setattr(namespace, self.dest + "_" + context, items)
but alas
Changelog: Fix: Fix help command for profile args Docs: TODO: To be changed with #14727 Fixed minor bug found while looking around profile show command code with @RubenRBS.
Changelog: Feature: Add shorthand syntax in cli to specify host and build in 1 argument
Docs: conan-io/docs#3439
There's some split preferences between possible names. This pr implements (for
-pr
,-s
,-o
,-c
)-s:a
(--settings:all
), but other possible names we discussed are:-s:hb
(settings:hostbuild
): Makes it more clear that this affects the host and build profiles-s:h,b
(settings:host,build
): Separates both names with a comma (Which is not a special char in any terminal as far as I can see), maybe easier to read?I'm open to change it to whatever everyone feels like a better one
The new profile args read like this:
Closes #14696