Bug 1351263
Summary: | [review] lr/cli-ask-rh1351263: [RFE] allow passing -a to the end of nmcli command | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Vladimir Benes <vbenes> |
Component: | NetworkManager | Assignee: | Lubomir Rintel <lrintel> |
Status: | CLOSED ERRATA | QA Contact: | Desktop QE <desktop-qa-list> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.3 | CC: | atragler, bgalvani, blueowl, fgiudici, lkundrak, lrintel, mleitner, rkhan, sukulkar, thaller |
Target Milestone: | rc | Keywords: | FutureFeature |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | NetworkManager-1.8.0-0.4.rc1.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-08-01 09:17:07 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1393481 |
Description
Vladimir Benes
2016-06-29 14:44:17 UTC
note that for convenience, nmcli supports all kind of abbreviations for options and arguments. Allowing options in every order makes parsing more complicated (maybe) and possibly more ambiguous. But sounds like a good thing to me. For now, assigning to Lubomir as he did the recent nmcli rework :) Although accepting options (--ask here) at the end might seem handy first, it would be at the cost of unnecessary complexity and ambiguity. And I think KISS principle should be kept here. --ask can be added with command-line (bash) editing shortcuts very simply :) Just pressing two shortcuts: Home Alt-F or Ctrl-A Alt-F and then adding "-a" option. A few useful links: * http://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/ * http://www.skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/ * https://wiki.archlinux.org/index.php/Keyboard_shortcuts * http://superuser.com/questions/344308/bash-jump-to-first-argument I believe it makes sense to process --ask anywhere. It also simplifies things a bit, since the concept of a global option concept removes the need for special casing of --show-secrets option. https://cgit.freedesktop.org/NetworkManager/NetworkManager/log/?h=lr/cli-ask-rh1351263 In process_command_line() there is now a redundant completion for --ask --show-secret: pushed a fixup on top of the branch for that. top commit msg: cli/connections: drop the redundant parsinG of --show-secrets (G is missing) Now the --ask and --show-secrets options are auto-completed everywhere. A couple of examples: 1) "nmcli" auto-completes main commands and just "--ask" and "--show-secrets" options only (before options were just suggested if "-" was found) 2) "nmcli conn show" auto-completes "--ask". Uglier, when autocompleted in "nmcli conn show uuid". Not sure is good having --ask and --show-secrets auto-completing everywhere. I think it is fine to have them enabled at any point in the command, but would be better to have more control on where they pop out in auto-completion. rest lgtm (In reply to Francesco Giudici from comment #4) > In process_command_line() there is now a redundant completion for --ask > --show-secret: pushed a fixup on top of the branch for that. > > top commit msg: > cli/connections: drop the redundant parsinG of --show-secrets > (G is missing) Fixed. > Now the --ask and --show-secrets options are auto-completed everywhere. > A couple of examples: > 1) "nmcli" auto-completes main commands and just "--ask" and > "--show-secrets" options only (before options were just suggested if "-" was > found) > 2) "nmcli conn show" auto-completes "--ask". Uglier, when autocompleted in > "nmcli conn show uuid". > > Not sure is good having --ask and --show-secrets auto-completing everywhere. > I think it is fine to have them enabled at any point in the command, but > would be better to have more control on where they pop out in > auto-completion. Good catch. I restored the behaviour where it completes when "-" is already seen. I think that in that case it makes sense to restore it in all cases where it's actually allowed. > rest lgtm Fixed up the first commit not to parse the global options when a value is expected. (e.g. so that nmcli c add con-name --ask would not change behavior) Pushed an updated branch lgtm Minor issue: nmcli connection show wired --show-secrets does not show secrets. Otherwise looks good. (In reply to Beniamino Galvani from comment #7) > Minor issue: > > nmcli connection show wired --show-secrets > > does not show secrets. Otherwise looks good. Yes, that is because the option is only read after the connection is processed. Will try to improve this in future. Merged as-is in fa292a60aa180101ff7192f5c0dd52231ea37356 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2017:2299 |