Commit Graph

11 Commits

Author SHA1 Message Date
Jiří Klimeš
758e488f13 nmcli: add global '--colors' option for controlling color output
nmcli -c auto  ->  colors will only be used when stdout is a terminal
nmcli -c yes   ->  colors will be enabled unconditionally
nmcli -c no    ->  colors will be disabled unconditionally
2015-02-23 09:24:21 +01:00
Jiří Klimeš
bc265d4372 nmcli: add support for terminal formatting, like bold, dim, underline, etc. 2015-02-23 09:24:21 +01:00
Jiří Klimeš
b77ec93d99 nmcli: add support for printing color strings 2015-02-23 09:24:21 +01:00
Jiří Klimeš
4e0e61f669 nmcli: pay attention to color escape sequencies when counting string length
This is to properly align the columns on screen.
2015-02-23 09:24:21 +01:00
Jiří Klimeš
3e8fc26d25 nmcli: make filtering color sequences a utility function
The code will be used on other places too.
2015-02-23 09:24:21 +01:00
Jiří Klimeš
bcd5b2cdc1 cli: fix DEADCODE (CWE-561) found by coverity
Error: DEADCODE (CWE-561): [#def3]
NetworkManager-0.9.11.0/clients/cli/utils.c:488: cond_notnull: Condition "input", taking true branch. Now the value of "input" is not "NULL".
NetworkManager-0.9.11.0/clients/cli/utils.c:517: notnull: At condition "input", the value of "input" cannot be "NULL".
NetworkManager-0.9.11.0/clients/cli/utils.c:517: dead_error_condition: The condition "input" must be true.
NetworkManager-0.9.11.0/clients/cli/utils.c:517: dead_error_line: Execution cannot reach the expression """" inside this statement: "g_set_error(error, 1U, 0, d...".
2014-12-12 22:43:33 +01:00
Lubomir Rintel
1c9b16b2f2 cli: Add mode option for wifi connecitons
Only default (infrastructure) mode connections can be created and as it's not
possible to write mode=ap connections with ifcfg-rh plugins, they can't be
switched to mode=ap.
2014-10-23 18:34:39 +02:00
Dan Winship
1b74e77f9f cli: use g_print/g_printerr rather than printf/fprintf
Use g_print() and g_printerr(), which wrap printf() and
fprintf(stderr,...), but handle conversion from UTF-8 if the locale is
using a different character set.
2014-09-27 11:45:53 -04:00
Dan Winship
1838db9e71 all: remove a bunch of unnecessary dbus/dbus-glib includes 2014-09-03 10:45:24 -04:00
Thomas Haller
ef24273104 cli: fix warning in parse_output_fields() about strict-overflow
gcc warns:

    make[4]: Entering directory `./NetworkManager/cli/src'
      CC       utils.o
    utils.c: In function ‘parse_output_fields’:
    utils.c:707:7: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
        if (found) {
           ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:01 +02:00
Dan Winship
3d25d70461 clients: reorganize source tree, put all the installed clients together
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/.
2014-07-30 15:56:19 -04:00