Commit Graph

30 Commits

Author SHA1 Message Date
Thomas Haller
7698d5dfc0 cli: bash completion completes filenames for team "config" property
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-22 14:10:34 +01:00
Thomas Haller
32b67cd1be cli: bash completion must not suggest IP options for adding slave types
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-18 16:38:07 +01:00
Thomas Haller
df7406fcf2 cli: add 'config' option to bash completion when adding team-slave connection
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>
2013-11-18 12:12:20 +01:00
Thomas Haller
6241366f30 cli: adjust bash completion for nmcli connection load <file>...
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-15 13:39:42 -05:00
Thomas Haller
bbddc0e18a cli: fix bash completion for curser not at EOL (2)
Previous commit had an error in the following case:
  $ nmcli connection modify  '  <TAB>     id

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-13 15:02:23 +01:00
Thomas Haller
93f5687d7b cli: fix bash completion for curser not at EOL
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>
2013-11-13 14:42:59 +01:00
Thomas Haller
ce370fab64 cli: add bash-completion for 'nmcli general hostname'
https://bugzilla.redhat.com/show_bug.cgi?id=1018510
2013-11-13 12:19:51 +01:00
Thomas Haller
ed60815d4c cli: improve handling of quoting in bash completion
_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>
2013-11-12 18:49:03 +01:00
Thomas Haller
6107a94099 cli: improve bash completion to complete -h and --help aliases
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-11 15:27:45 +01:00
Dan Williams
7d57386e04 cli: add support for 'nmcli dev connect ifname XXX' 2013-10-31 15:45:21 -05:00
Dan Williams
42c7ea85a1 cli: add support for 'nmcli con up ifname XXX'
Passes a NULL connection to nm_client_activate_connection() allowing
NetworkManager to pick the best available connection for the interface.
2013-10-31 15:45:20 -05:00
Thomas Haller
623f8a2be1 cli: fix bash completion for nmcli connection modify
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>
2013-10-30 13:33:47 +01:00
Thomas Haller
2a7c976539 cli: show property names in bash completion for nmcli connection modify
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-10-24 14:52:08 +02:00
Thomas Haller
78a8df37d8 cli: fix bash completion to show general options
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>
2013-10-03 16:05:44 +02:00
Thomas Haller
f37686fba7 cli: add primary bonding option in bash completion
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-10-02 14:19:12 +02:00
Thomas Haller
ed08a3fe04 cli: fix missing type option 'team' in mcli completion
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-30 19:07:18 +02:00
Thomas Haller
8548d68381 nmcli: extend bash completion for 'nmcli networking connectivity'
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-12 16:19:42 +02:00
Thomas Haller
7ad5c79441 nmcli: minor fixes in bash completion
- 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>
2013-09-06 17:47:57 +02:00
Thomas Haller
fc7468131c nmcli: major rework of bash completion
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>
2013-09-05 10:47:41 +02:00
Thomas Haller
2d2b2a48eb cli: change completion to suggest connection ids
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>
2013-08-28 14:36:49 +02:00
Thomas Haller
ab231cb0d9 cli: improve bash completion by parsing options separately.
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>
2013-08-28 14:36:49 +02:00
Thomas Haller
e2f77d30b1 cli: make bash-completion for nmcli support more abbreviations.
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>
2013-08-13 14:17:44 +02:00
Thomas Haller
faa6a12ba3 cli: make bash-completion support abbreviated object names.
nmcli accepts abbreviated versions of object names, e.g. 'con'
instead of 'connection'. Adjust bash completion to also support
this.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-08-12 13:33:13 -05:00
Jiří Klimeš
34ab351284 cli: update bash-completion file for 'connection modify' 2013-07-22 13:37:17 +02:00
Jiří Klimeš
ead6d31eac cli: update bash-completion file for 'connection edit' 2013-07-22 13:37:16 +02:00
Jiří Klimeš
790b3a753c cli: update bash completion file - 'nmcli connection reload' 2013-06-18 15:45:16 +02:00
Jiří Klimeš
2b843dac50 cli: change '--private' to 'private yes|no' in 'nmcli dev wifi connect'
Missing 'private' argument default to private=no, the same way as before.
2013-05-16 10:28:40 +02:00
Jiří Klimeš
24f05292da cli: update bash-completion file for 'connection add'
* _nmcli_list vs. _nmcli_list_nl - space vs. new-line separated list
* connection add
  - various types, modes, mac, ifname, ...
2013-05-07 19:41:37 +02:00
Jiří Klimeš
654a79ba88 cli: update bash completion file for the new syntax 2013-04-09 10:31:13 +02:00
Michael Biebl
1556a19c3e Add bash-completion file for nmcli
Based on work by Guillaume Rousse <guillomovitch@gmail.com>
2013-02-19 21:20:59 +01:00