summaryrefslogtreecommitdiff
path: root/cli
Commit message (Collapse)AuthorAgeFilesLines
* clients: reorganize source tree, put all the installed clients togetherDan Winship2014-07-3019-24541/+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-222-4/+127
| | | | | | | 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
* cli: show whether the device is software-based in CAPABILITIESJiří Klimeš2014-07-221-2/+4
|
* cli: show IS-SOFTWARE property in GENERAL section for devicesJiří Klimeš2014-07-221-13/+15
|
* build: more srcdir!=builddir fixesDan Winship2014-07-151-1/+0
| | | | | | | | nm-version.h was getting disted, making srcdir!=builddir work for tarball builds, but not for git builds. Also, remove "-I${top_builddir}/include" from all Makefile.ams, since there's nothing generated in include/ any more.
* build: fix nm-setting-docs build in various configurationsDan Winship2014-06-272-2/+2
| | | | | | | Certain build configurations (like --enable-gtk-doc --disable-introspection) were broken with respect to nm-setting-docs. Fix this. Also, we don't require just gobject-introspection, we need pygobject specifically as well.
* cli: make Ctrl-C exit nmcli when line is empty *and* we are not in the editorJiří Klimeš2014-06-244-5/+25
|
* cli: don't print "Error: nmcli terminated by signal Quit (3)" on Ctrl-DJiří Klimeš2014-06-243-2/+16
| | | | Also make sure we don't print anything before quitting on Ctrl-D.
* cli: append NL to error messages and also print the signal nameJiří Klimeš2014-06-241-5/+7
|
* cli: allow quitting on Ctrl-D while in readline()Jiří Klimeš2014-06-241-0/+7
| | | | | | | | | | Ctrl-D is mapped as a delete key in readline. When some input is on the line, Ctrl-D behaves like 'Delete' key. When the line is empty, EOF is generated. We quit on this EOF. It is the same behaviour many other interactive programs exhibit, like bash, python, irb, etc. Users can also quit unconditionally with Ctrl-\ that traditionally generates SIGQUIT.
* cli: mitigate slowness of readline() for some broken versionsJiří Klimeš2014-06-241-0/+4
| | | | | | | | | | | | | | | | There was a bug in readline-6.2 causing very slow processing when rl_event_hook was used [1]. This was fixed later after 6.2 was out. Unfortunately some distributions don't include the fix. Fedora is one example [2]. So we lower keyboard input timeout from 0.1s to 0.01s. This makes readline more responsive. On the other hand it causes more interrupts, calling rl_event_hook callback more often and thus slightly higher CPU usage. [1] https://lists.gnu.org/archive/html/bug-readline/2012-06/msg00005.html [2] related: https://bugzilla.redhat.com/show_bug.cgi?id=1109946 Note: this commit could (should) be reverted later when we check that most distributions have the readline bug fixed.
* cli: don't quit nmcli on Ctrl-C while in readline()Jiří Klimeš2014-06-244-6/+99
| | | | | We rather cancel the input and show new prompt on readline. It is more expected behaviour for interactive input when quitting.
* cli: make "(not available)" translatableJiří Klimeš2014-06-201-1/+1
|
* cli: generate setting docs from libnm-util/nm-setting-docs.xmlDan Winship2014-06-193-8/+109
| | | | | | nmcli used the GParamSpec doc strings to get property descriptions, but they will be going away. Generate a .c file from the new XML setting docs file, and link that into nmcli.
* cli: clarify nmcli description for route metricJiří Klimeš2014-06-191-2/+2
|
* cli: editor - do not print separator when printing one settingJiří Klimeš2014-06-191-0/+1
|
* cli: editor - enhance TAB completion for 'print' commandJiří Klimeš2014-06-191-4/+39
|
* cli: editor - enhance 'print' commandJiří Klimeš2014-06-191-10/+48
| | | | | | | | | | | | - 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 ...
* 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: don't accept prefix 0 for routesJiří Klimeš2014-06-111-2/+2
|
* cli: don't accept default route entries, NM handles the default route itselfJiří Klimeš2014-06-111-0/+8
|
* cli: allow missing next hop for routes (bgo #727615)Jiří Klimeš2014-06-113-105/+163
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=727615
* cli: fix a couple errors noticed by coverityDan Williams2014-06-061-23/+26
|
* cli: fix error parsing input arguments in non-interactive modeThomas Haller2014-06-061-2/+4
| | | | | | | | | | | | | | 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 bfb1200b4f279f83c113d048839044ad51ca2af7. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: switch to the new-style readline typedefs (bgo #731294)Jiří Klimeš2014-06-064-40/+39
| | | | | | | | | | | 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
* cli: use readline for quit confirmation in editor, and accept localized answerJiří Klimeš2014-06-041-14/+22
|
* cli: implement TAB completion for connection and interface namesJiří Klimeš2014-06-042-9/+112
| | | | | | | For commands like nmcli -a dev disconnect nmcli -a con up ...
* cli: implement TAB completion for inputs in questionnaire modeJiří Klimeš2014-06-041-168/+290
| | | | | | and also - accept yes/no options as localized strings - simplify some questionnaire code
* cli: use readline also in other commands (besides interactive editor)Jiří Klimeš2014-06-042-83/+112
| | | | | It is used for '--ask' option. The main use is for questionnaires (nmcli -a con add).
* cli: make prompt argument a printf-like format string, remove history argumentJiří Klimeš2014-06-043-28/+25
| | | | for nmc_readline()
* cli: move readline related functions to common.h to be usable throughout nmcliJiří Klimeš2014-06-045-71/+102
| | | | | | | | | 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.
* cli/build: make libreadline a build-time dependency (bgo #729846)Jiří Klimeš2014-06-042-200/+57
| | | | | | | | | | 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
* cli: don't leak 'str' returned by g_strdup_vprintf()Jiří Klimeš2014-06-041-2/+4
|
* cli: add optional 'mac' argument for 'nmcli con add type bridge'Jiří Klimeš2014-05-302-6/+30
| | | | | | | 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: support new bridge.mac-address propertyJiří Klimeš2014-05-301-12/+23
|
* cli: don't use nm_utils_hwaddr_type() to stringify HWADDRThomas Haller2014-05-291-2/+2
| | | | | | | | | | 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>
* cli: do not restrict VPN type of created connections (rh #1100750)Jiří Klimeš2014-05-282-12/+10
| | | | | | | | 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
* cli: extract username and gateway for some more VPN typesJiří Klimeš2014-05-281-0/+5
|
* all: g_type_init() has been deprecated in GLib 2.35.0Jiří Klimeš2014-05-271-0/+2
| | | | | g_type_init() deprecation: https://bugzilla.gnome.org/show_bug.cgi?id=686161
* cli: add missing reason-to-string mappings for NMDeviceStateReasonJiří Klimeš2014-05-261-0/+9
|
* cli: TAB completion for connection.secondariesJiří Klimeš2014-05-231-20/+123
| | | | | We complete UUIDs, because that's easier (no spaces or special characters). Readline display hook allows to display profile name too, though.
* cli: only allow setting VPN connection as secondaries in editorJiří Klimeš2014-05-231-0/+16
|
* cli: fix completion of interfaces in editor for "activate" commandJiří Klimeš2014-05-151-1/+1
|
* cli: fix ambiguity of "o" (on vs off) in nmc_string_to_bool()Jiří Klimeš2014-05-151-0/+6
|
* nmcli/completion: fix logging domain "OLPC" for nmcli bash completionThomas Haller2014-05-121-1/+1
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* all: fix various warnings detected with coverityThomas Haller2014-05-021-1/+1
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=728320 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>
* all: set G_LOG_DOMAIN appropriately, for better g_log() messagesDan Winship2014-04-231-0/+1
|
* nmcli: improve setting connection.secondaries propertyJiří Klimeš2014-04-225-69/+130
| | | | | | | | | - 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())
* 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