Jiří Klimeš
f227d25ed9
cli: clarify nmcli description for route metric
2014-06-19 10:04:08 +02:00
Jiří Klimeš
7c41835203
cli: editor - do not print separator when printing one setting
2014-06-19 09:24:07 +02:00
Jiří Klimeš
9ab59bdfac
cli: editor - enhance TAB completion for 'print' command
2014-06-19 09:24:07 +02:00
Jiří Klimeš
e7830c7925
cli: editor - enhance 'print' command
...
- allow printing single properties:
nmcli> print con.id
connection.id: my-main-ethernet
- allow printing other settings in second (settings) menu level:
nmcli connection> print ipv4.method
ipv4.method: auto
nmcli connection> print eth
...
2014-06-19 09:23:07 +02:00
Swapnil Nagarkar
2e3523bb43
nmcli autocomplete tab display : rename ERROR to ERR
...
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>
2014-06-12 14:29:13 +02:00
Jiří Klimeš
e70d5579af
cli: don't accept prefix 0 for routes
2014-06-11 10:07:02 +02:00
Jiří Klimeš
4e9fc8ad61
cli: don't accept default route entries, NM handles the default route itself
2014-06-11 09:58:44 +02:00
Jiří Klimeš
700f5ec0ef
cli: allow missing next hop for routes (bgo #727615 )
...
https://bugzilla.gnome.org/show_bug.cgi?id=727615
2014-06-11 09:58:39 +02:00
Dan Williams
dacee1485a
cli: fix a couple errors noticed by coverity
2014-06-06 17:25:36 -05:00
Thomas Haller
bcb9f6c910
cli: fix error parsing input arguments in non-interactive mode
...
Causes the following failure:
$ /bin/nmcli connection add type ethernet con-name connie ifname '*'
(process:13883): GLib-CRITICAL **: g_strchug: assertion `string != NULL' failed
(process:13883): GLib-CRITICAL **: g_strchomp: assertion `string != NULL' failed
Error: invalid connection type; '' not among [generic, ...].
Regression introduced by commit bfb1200b4f .
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-06 23:19:49 +02:00
Jiří Klimeš
dae8391436
cli: switch to the new-style readline typedefs (bgo #731294 )
...
The old Function, CPFunction, CPPFunction and VFunction typedefs are
considered deprecated starting from readline 4.2 (though were not marked
as such): http://lists.gnu.org/archive/html/bug-bash/2000-10/msg00078.html
Compatibility typedefs have been in place up to readline 6.2 but were
removed with the 6.3 release thus causing build to break.
http://lists.gnu.org/archive/html/bug-readline/2014-04/msg00018.html
https://bugzilla.gnome.org/show_bug.cgi?id=731294
2014-06-06 11:34:23 +02:00
Jiří Klimeš
82db87a144
cli: use readline for quit confirmation in editor, and accept localized answer
2014-06-04 09:47:37 +02:00
Jiří Klimeš
00c700bf2c
cli: implement TAB completion for connection and interface names
...
For commands like
nmcli -a dev disconnect
nmcli -a con up
...
2014-06-04 09:47:37 +02:00
Jiří Klimeš
bfb1200b4f
cli: implement TAB completion for inputs in questionnaire mode
...
and also
- accept yes/no options as localized strings
- simplify some questionnaire code
2014-06-04 09:47:37 +02:00
Jiří Klimeš
480f69e23f
cli: use readline also in other commands (besides interactive editor)
...
It is used for '--ask' option. The main use is for questionnaires
(nmcli -a con add).
2014-06-04 09:47:37 +02:00
Jiří Klimeš
b71af5b144
cli: make prompt argument a printf-like format string, remove history argument
...
for nmc_readline()
2014-06-04 09:47:37 +02:00
Jiří Klimeš
a3d89d65c4
cli: move readline related functions to common.h to be usable throughout nmcli
...
Renames
readline_x() to nmc_readline()
gen_func_basic() to nmc_rl_gen_func_basic()
The commit doesn't change functionality, only moves and renames the functions,
so that they can be used in other places too.
2014-06-04 09:47:37 +02:00
Jiří Klimeš
03be41d409
cli/build: make libreadline a build-time dependency (bgo #729846 )
...
and link nmcli against it.
This simplifies code, makes sure that line editing capability is supported,
and will allow using readline on other places too.
https://bugzilla.gnome.org/show_bug.cgi?id=729846
https://bugzilla.redhat.com/show_bug.cgi?id=1007365
2014-06-04 09:47:37 +02:00
Jiří Klimeš
fd93fb9fb9
cli: don't leak 'str' returned by g_strdup_vprintf()
2014-06-04 08:55:35 +02:00
Jiří Klimeš
e88979a354
cli: add optional 'mac' argument for 'nmcli con add type bridge'
...
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
2014-05-30 17:02:31 +02:00
Jiří Klimeš
43edc90438
cli: support new bridge.mac-address property
2014-05-30 17:02:31 +02:00
Thomas Haller
c4d90c5660
cli: don't use nm_utils_hwaddr_type() to stringify HWADDR
...
Use nm_utils_hwaddr_ntoa_len() instead of nm_utils_hwaddr_ntoa().
This makes it no longer necessary to determine the type of the MAC
address based on the address length.
This makes the GETTER more accepting towards other lengths.
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-29 19:00:59 +02:00
Jiří Klimeš
d7216505bb
cli: do not restrict VPN type of created connections (rh #1100750 )
...
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
2014-05-28 09:37:15 +02:00
Jiří Klimeš
649e4be103
cli: extract username and gateway for some more VPN types
2014-05-28 09:37:15 +02:00
Jiří Klimeš
98ae6e06d2
all: g_type_init() has been deprecated in GLib 2.35.0
...
g_type_init() deprecation:
https://bugzilla.gnome.org/show_bug.cgi?id=686161
2014-05-27 16:58:21 +02:00
Jiří Klimeš
6f9601030a
cli: add missing reason-to-string mappings for NMDeviceStateReason
2014-05-26 14:07:01 +02:00
Jiří Klimeš
e6f1c8329f
cli: TAB completion for connection.secondaries
...
We complete UUIDs, because that's easier (no spaces or special characters).
Readline display hook allows to display profile name too, though.
2014-05-23 12:19:29 +02:00
Jiří Klimeš
7696238e84
cli: only allow setting VPN connection as secondaries in editor
2014-05-23 12:19:29 +02:00
Jiří Klimeš
2b37ee2b7a
cli: fix completion of interfaces in editor for "activate" command
2014-05-15 13:43:02 +02:00
Jiří Klimeš
e8f5a82e22
cli: fix ambiguity of "o" (on vs off) in nmc_string_to_bool()
2014-05-15 09:50:52 +02:00
Thomas Haller
3a19de80f7
nmcli/completion: fix logging domain "OLPC" for nmcli bash completion
...
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-12 19:00:00 +02:00
Thomas Haller
9ef23947cc
all: fix various warnings detected with coverity
...
https://bugzilla.gnome.org/show_bug.cgi?id=728320
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-05-02 15:20:30 +02:00
Thomas Haller
9305c5bbf7
man/cli: add missing log domains to manual page and nmcli bash completion
...
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-24 17:27:47 +02:00
Dan Winship
bea82ca98b
all: set G_LOG_DOMAIN appropriately, for better g_log() messages
2014-04-23 10:19:17 -04:00
Jiří Klimeš
645f0204f9
nmcli: improve setting connection.secondaries property
...
- check if the values being set are existing connections
- also allow specifying connections by names, translating them transparently
to UUIDs.
- nmcli-specific section for 'describe' command added
(We use a global nm_cli variable in nmc_property_connection_set_secondaries())
2014-04-22 12:40:40 +02:00
Jiří Klimeš
b911d663d8
cli/bash-completion: escape spaces in profile names (rh #1041901 ) (bgo #709426 )
...
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
2014-04-15 16:32:02 +02:00
Yuri Chornoivan
b25c227e07
fix typos in documentation and messages
...
https://bugzilla.gnome.org/show_bug.cgi?id=727031
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-04-03 17:12:31 +02:00
Dan Williams
408ecd6b5f
cli: fix setting DCB application priority (rh #1080510 )
...
Priority was originally a 'guint' but then got changed to 'gint' and
apparently we forgot to fix one place up.
2014-04-02 12:06:14 -05:00
Jiří Klimeš
c1e5493117
nmcli: use correct Mbit/s units for maximal bitrate (rh #1080474 )
...
https://bugzilla.redhat.com/show_bug.cgi?id=1080474
2014-04-01 15:15:17 +02:00
Jiří Klimeš
4209f170da
nmcli: fix an error when showing progress of activation in editor
...
(process:7213): CRITICAL **: nm_active_connectiuon_get_state: assertion `NM_IS_ACTIVE_CONNECTION (connection)' failed
2014-03-31 18:10:55 +02:00
Jiří Klimeš
a1e89b4d29
cli: fix bridge priority default value (rh #1073664 )
...
It is 32768 (0x8000) instead of 128 (0x80). 13c348d fixes that in the setting.
https://bugzilla.redhat.com/show_bug.cgi?id=1073664
2014-03-17 09:08:23 +01:00
Jiří Klimeš
08ed6c5be2
cli: sanitize team config before setting it into property
...
Replace '\r' and '\n' chareacter with a space in the configuration.
libteamdctl sends the config to team daemon using its usock interface that
separates parameters with '\n'.
Related: rh #1051517
2014-03-12 10:44:29 +01:00
Jiří Klimeš
d7e1ec9183
cli: accept prefix "ifname/", "uuid/" or "id/" for 'master' argument
...
nmcli con add type team-slave ifname em2 master team-master0
nmcli con add type team-slave ifname em2 master id/team-master0
It helps to disambiguate values for cases where they may overlap,
e.g. "team0" -> "ifname/team0" or "id/team0"
2014-03-12 10:32:37 +01:00
Jiří Klimeš
90c02cafdc
cli: allow specifying 'master' for slaves as connection ID (rh #1057494 )
...
nmcli con add type *-slave ifname em1 master <ifname|UUID|name>
'master' property of 'connection' setting has to be either interface name or
connection UUID of master connection. However, to make nmcli more convenient
for users, we also allow specifying connection name and translating it to UUID
automatically.
https://bugzilla.redhat.com/show_bug.cgi?id=1057494
2014-03-12 10:32:11 +01:00
Jiří Klimeš
296d7f6ec7
cli: fix a crash when trying to set a white-space string as IP (rh #1071394 )
...
nmcli con modify my-profile ipv4.addr " "
nmcli con modify my-profile ipv6.addr " "
Note:
Empty string should be used to remove IPs, and 'method' might be needed to set
to 'auto' simultaneously, as well.
$ nmcli con modify profile1 ipv4.addr "" ipv4.method auto
https://bugzilla.redhat.com/show_bug.cgi?id=1071394
2014-03-03 12:50:02 +01:00
Thomas Haller
90ff0786cc
cli/bash-completion: fix nmcli connection CMD completion for --help option
...
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>
2014-03-02 17:55:14 +01:00
Thomas Haller
74b3c22e2f
cli/bash-completion: only allow --help as first argument for nmcli connection modify
...
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-01 02:07:53 +01:00
Thomas Haller
9d7a1d4253
cli/bash-completion: use printf instead of echo (because echo inteprets some --options)
...
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-01 02:07:53 +01:00
Thomas Haller
39dc39ec0a
cli/bash-completion: simplify code by passing arrays by indirection to functions
...
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-01 02:07:53 +01:00
Thomas Haller
62cf1d85ff
cli/bash-completion: complete more then one connections for nmcli connection delete
...
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:14:32 +01:00