summaryrefslogtreecommitdiff
path: root/cli/completion
Commit message (Collapse)AuthorAgeFilesLines
* clients: reorganize source tree, put all the installed clients togetherDan Winship2014-07-302-1239/+0
| | | | | | | | | | | | | Create a new clients/ subdirectory at the top level, and move cli/ and tui/ into it, as well as nm-online.c (which was previously in test/, which made no sense). cli/ was split into two subdirectories, src/ and completion/. While this does simplify things (given that the completion file and the binary both need to be named "nmcli"), it bloats the source tree, and we can work around it by just renaming the completion file at install time. Then we can combine the two directories into one and just have it all under clients/cli/.
* cli: add 'nmcli device delete <ifname>' command (rh #1034150)Jiří Klimeš2014-07-221-2/+3
| | | | | | | It only works for software devices. When called for a hardware device, an error is returned and the device is not deleted. https://bugzilla.redhat.com/show_bug.cgi?id=1034150
* nmcli autocomplete tab display : rename ERROR to ERRSwapnil Nagarkar2014-06-121-1/+1
| | | | | | | | | | The nmcli auto completation shows log levels as ERROR. But giving ERROR it does not work. This should renamed from ERROR to ERR https://mail.gnome.org/archives/networkmanager-list/2014-June/msg00019.html Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: add optional 'mac' argument for 'nmcli con add type bridge'Jiří Klimeš2014-05-301-1/+1
| | | | | | | This allows setting bridge MAC either on command-line nmcli con add type bridge con-name mybridge mac 11:22:33:44:55:66 or provide it when asked nmcli -a con add type bridge con-name mybridge
* cli: do not restrict VPN type of created connections (rh #1100750)Jiří Klimeš2014-05-281-1/+1
| | | | | | | | There may be third-party VPN plugins nmcli is not aware of. We still print a warning if nmcli doesn't know the type. It helps to catch up typos. https://bugzilla.redhat.com/show_bug.cgi?id=1100750
* nmcli/completion: fix logging domain "OLPC" for nmcli bash completionThomas Haller2014-05-121-1/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* man/cli: add missing log domains to manual page and nmcli bash completionThomas Haller2014-04-241-1/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: escape spaces in profile names (rh #1041901) (bgo #709426)Jiří Klimeš2014-04-151-0/+30
| | | | | | | | | We need to escape spaces and quotes in connection names, so that a connection name containing spaces (quotes) is regarded as a single argument by bash. See e.g. http://stackoverflow.com/questions/1146098/properly-handling-spaces-and-quotes-in-bash-completion https://bugzilla.redhat.com/show_bug.cgi?id=1041901 https://bugzilla.gnome.org/show_bug.cgi?id=709426
* cli/bash-completion: fix `nmcli connection CMD` completion for --help optionThomas Haller2014-03-021-10/+108
| | | | | | | The --help option (or its aliases -help/help) is only allowed at as first argument. Fix completion to account for this. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: only allow --help as first argument for nmcli ↵Thomas Haller2014-03-011-18/+47
| | | | | | connection modify Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: use printf instead of echo (because echo inteprets some ↵Thomas Haller2014-03-011-7/+4
| | | | | | --options) Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: simplify code by passing arrays by indirection to functionsThomas Haller2014-03-011-57/+76
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: complete more then one connections for `nmcli ↵Thomas Haller2014-02-281-1/+19
| | | | | | connection delete` Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: complete more then one properties for `nmcli connection ↵Thomas Haller2014-02-281-3/+11
| | | | | | modify` Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: complet nmcli connection modify --temporaryThomas Haller2014-02-281-1/+20
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: support abbreviated options for commandsThomas Haller2014-02-281-4/+12
| | | | | | | | Add support for abbreviated options as first argument: nmcli connection show --act <TAB> Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: support abbreviations for optionsThomas Haller2014-02-281-40/+70
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: make 'ifname' a mandatory parameter for `nmcli ↵Thomas Haller2014-01-301-3/+27
| | | | | | | | | connection add` For some connection types (bond, bridge, team and vlan), 'ifname' is optional. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: complete 'save' option for `nmcli connection add`Thomas Haller2014-01-301-1/+2
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: update completion for new `nmcli connection show` syntaxThomas Haller2014-01-231-39/+40
| | | | | | | | As nmcli changes the syntax for the 'connection show' command, this patch for bash completion also breaks several cases when completing for an old nmcli command. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: trivial rename of functionsThomas Haller2014-01-101-45/+45
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: add second level help optionThomas Haller2014-01-101-15/+35
| | | | | | Commands now support help at the second level. Add completion for it. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: only complete active connections for `nmcli con down`Thomas Haller2014-01-101-2/+7
| | | | | | | Only complete the ids/uuids for active connections in `nmcli connection down <type> <TAB>`. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: cleanup/refactor by making functions genericThomas Haller2014-01-101-72/+28
| | | | | | | Instead of having several bash functions that return some values via nmcli, add few functions that accept parameters. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: fix wrong completion for `nmcli device wimax`Thomas Haller2014-01-101-18/+0
| | | | | | wimax does not support these arguments. This was a copy&paste error from wifi. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli/bash-completion: remove not yet implemented device type 'adsl'Thomas Haller2014-01-101-1/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: add pppoe type to nmcli bash completionThomas Haller2013-12-181-1/+7
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix bash-completion for nmcli connection load (rh #1036545)Jiří Klimeš2013-12-171-1/+1
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1036545
* cli: bash completion completes filenames for team "config" propertyThomas Haller2013-11-221-1/+7
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: bash completion must not suggest IP options for adding slave typesThomas Haller2013-11-181-0/+3
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: add 'config' option to bash completion when adding team-slave connectionThomas Haller2013-11-181-1/+1
| | | | | | | Like 'team', 'team-slave' also understands the property 'config'. Add it to bash completion for the 'connection add' command. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: adjust bash completion for `nmcli connection load <file>...`Thomas Haller2013-11-151-0/+6
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix bash completion for curser not at EOL (2)Thomas Haller2013-11-131-1/+1
| | | | | | | Previous commit had an error in the following case: $ nmcli connection modify ' <TAB> id Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix bash completion for curser not at EOLThomas Haller2013-11-131-0/+7
| | | | | | | | | | | | | If the curser is not at the end of the line, we want to complete by ignoring everything right of the curser. However, the variable $cur is set to the spaces since the last word, so we have to get rid of them first Without this, the following did not complete: $ nmcli connection modify id <TAB> lo because $cur is set to ' '. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: add bash-completion for 'nmcli general hostname'Thomas Haller2013-11-131-1/+10
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1018510
* cli: improve handling of quoting in bash completionThomas Haller2013-11-121-0/+6
| | | | | | | | | | | | | _init_completion returns the '${words[@]}' array with all the quotes and escapes. We dont care about it so we drop (unescape) first. Before, the following failed: nmcli 'c' <TAB> nmcli connection modify id Wireless\ Connection\ 1 <TAB> Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: improve bash completion to complete -h and --help aliasesThomas Haller2013-11-111-8/+15
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: add support for 'nmcli dev connect ifname XXX'Dan Williams2013-10-311-1/+2
|
* cli: add support for 'nmcli con up ifname XXX'Dan Williams2013-10-311-3/+16
| | | | | Passes a NULL connection to nm_client_activate_connection() allowing NetworkManager to pick the best available connection for the interface.
* cli: fix bash completion for `nmcli connection modify`Thomas Haller2013-10-301-1/+3
| | | | | | | | | | | | Only complete the setting name if it is at the very first position after the connection. e.g. complete the settings name in the case $ nmcli connection modify em1 connec<TAB> but not at $ nmcli connection modify em1 connection.autoconnect <TAB> Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: show property names in bash completion for `nmcli connection modify`Thomas Haller2013-10-241-9/+10
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix bash completion to show general optionsThomas Haller2013-10-031-2/+2
| | | | | | | | | | This fixes an error in the following example: $ nmcli con add type bridge con-name test-bridge <TAB> Before, general options such as 'autoconnect' and 'ifname' were wrongly not suggested. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: add primary bonding option in bash completionThomas Haller2013-10-021-1/+2
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix missing type option 'team' in mcli completionThomas Haller2013-09-301-1/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* nmcli: extend bash completion for 'nmcli networking connectivity'Thomas Haller2013-09-121-1/+7
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* nmcli: minor fixes in bash completionThomas Haller2013-09-061-2/+11
| | | | | | | - the ifname argument for "connection add" is not mandatory - support the long names for connection types ("802-*") Signed-off-by: Thomas Haller <thaller@redhat.com>
* nmcli: major rework of bash completionThomas Haller2013-09-051-180/+658
| | | | | | | | | | | | | | | | Bash completion does now parse the command line from left to right and only suggests options that make sense at the current cursor position. If the cursor is not at the end of the line, the words right from the cursor are ignored for completion. The reason is, that it would be much more difficult to figure out the valid options when also looking at options right from the cursor. However, it should still work nicely even in this case. There is still an unsolved issue when completing words with space or other special characters. However, this issue was present before. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: change completion to suggest connection idsThomas Haller2013-08-281-7/+12
| | | | | | | | | | Before, whereever a connection id is accepted, the completion only offered 'id', 'uuid', 'path', etc. With this change, it will additionally suggest the id of existing connections. https://bugzilla.redhat.com/show_bug.cgi?id=997997 Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: improve bash completion by parsing options separately.Thomas Haller2013-08-281-175/+254
| | | | | | | | | | | | | | To support optimal completion, more context must be considered. Especially the OPTIONS, which must appear before the OBJECT. Modify bash completion to try parsing first the options. Before, whenever you had options, completion did not work anymore (because the object was expected as first argument). Moreover, options were also suggested after specifying the object. This is now mitigated by parsing the command line in two steps. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: make bash-completion for nmcli support more abbreviations.Thomas Haller2013-08-131-128/+141
| | | | | | | | | Also sub commands can be abbreviated. Add some more aliases to the bash completion. Also fix the option 'nmcli radio mobile' which is called 'wwan'. Signed-off-by: Thomas Haller <thaller@redhat.com>