cli: add 'help' for second level commands (bgo #698237) (rh #1034119)

In addition to 'nmcli connection help', you can now use:
nmcli con up help
nmcli con down help
nmcli dev wifi help
etc.

The help option can also be in the form of --help/-h, or even shortened.

https://bugzilla.gnome.org/show_bug.cgi?id=698237
https://bugzilla.redhat.com/show_bug.cgi?id=1034119
cli/bash-completion: remove not yet implemented device type 'adsl'

Signed-off-by: Thomas Haller <thaller@redhat.com>
cli/bash-completion: fix wrong completion for `nmcli device wimax`

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: cleanup/refactor by making functions generic

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: only complete active connections for `nmcli con down`

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: add second level help option

Commands now support help at the second level. Add completion for it.

Signed-off-by: Thomas Haller <thaller@redhat.com>
cli/bash-completion: trivial rename of functions

Signed-off-by: Thomas Haller <thaller@redhat.com>
cli: fix printing error on incorrect 'nmcli -f blah dev show'

Don't print extra empty lines before the error.
libnl-util: refactor nm_utils_ip4_prefix_to_netmask/netmask_to_prefix

- use a more efficient implementation for prefix_to_netmask
- fix netmask_to_prefix to behave consistently in case of
  invalid netmask
- remove unused duplicated functions from NetworkManagerUtils.c
- add test functions

Based-on-patch-by: Pavel Šimerda <psimerda@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Related: https://bugzilla.gnome.org/show_bug.cgi?id=721771
po: update German (de) translation (bgo #722061)

https://bugzilla.gnome.org/show_bug.cgi?id=722061

Signed-off-by: Thomas Haller <thaller@redhat.com>
po: update Ukrainian (uk) translation (bgo #722130)

https://bugzilla.gnome.org/show_bug.cgi?id=722130

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm-glib: add NMActiveConnection:vpn property

It is mainly useful for GObject introspection users helping them to find out
whether the connection is VPN easier.
libnm-util: raise CHANGED signal in nm_connection_clear_secrets only on change

Often, nm_connection_clear_secrets does have no consequences, because
there is nothing to be cleared. Only raise a signal, if something
actually changed.

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm-util: raise CHANGED signal in nm_connection_update_secrets only on change

This changes behaviour of nm_connection_update_secrets() in that it will
now return %TRUE, if there are no secrets to be cleared. Seems more
correct, to return success if there is nothing to do.

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm-util: only emit one CHANGED signal when adding several settings

Signed-off-by: Thomas Haller <thaller@redhat.com>
core: trivial rename NMSettings signal dbus-updated to updated-by-user

https://bugzilla.redhat.com/show_bug.cgi?id=1040528

Signed-off-by: Thomas Haller <thaller@redhat.com>
core: emit UPDATED_BY_USER signal when reloading connection from file

Now UPDATED_BY_USER signal gets emitted immediately after the connection
is updated, rather then only after it is successfully saved.

This means, that the signal will be emitted earlier then before (right
after changing the connection, but before it gets commited).
Furthermore, the signal will also be emitted for connections that
get changed but are not to be saved.

Currently, the only subscriber to this signal is NMSettings
(default_wired_connection_updated_by_user_cb), which should be fine with
this change of semantics (even better).

https://bugzilla.redhat.com/show_bug.cgi?id=1040528

Signed-off-by: Thomas Haller <thaller@redhat.com>
core: add signal CONNECTION_UPDATED_BY_USER to NMSettings

This forwards the signal UPDATED_BY_USER received from one of their
NMConnection.

Signed-off-by: Thomas Haller <thaller@redhat.com>
core: reset auto-retry counter when a connection gets updated

This restores the behaviour, that was removed in commit
e299d7b30f7accbd83270fb1eb973fd903714d77.

https://bugzilla.redhat.com/show_bug.cgi?id=1040528

Signed-off-by: Thomas Haller <thaller@redhat.com>
man: update and define logging domains in NetworkManager.conf manual page