NetworkManager/clients/cli
Thomas Haller 94ecdc0cb9 cli: rework check-colors to first evaluate enabled/disabled
With --color=auto, coloring is enabled based on the .enable/.disable
termcolors files.

Likewise, when we enable coloring, we parse the color palette from the
.schem termcolors files.

The termcolors files are searched by finding the best match depending
on the terminal and application name. Note, that if we find a matching
file like "nmcli@xterm.enable" we still allow loading the palette from
a less specific file like "nmcli.schem" and vice versa. That was already
done before.

Previously, the search was done by calling several layers of functions, and having
in/out arguments "color_option" and "p_palette_buffer". in/out paramters
here seems confusing to me, as they are state that gets modified and carried
along.

Instead, rework the functions to clearly separate between input
and output arguments.

Also, in the auto-case, check_colors() now first determines whether
coloring is enabled, before even starting loading the palette.
This avoids loading the palette until we are sure that we need it.
2018-06-26 11:32:39 +02:00
..
agent.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
agent.h cli: add 'nmcli agent' command (bgo #739568) 2014-11-07 11:58:25 +01:00
common.c cli: return NULL strv array from _ip_config_get_routes() if there are no routes 2018-06-15 11:48:16 +02:00
common.h cli: rework connection handling for multiple results 2018-05-14 17:53:03 +02:00
connections.c cli: list the 'print' command in the welcome message of the editor 2018-06-21 16:56:50 +02:00
connections.h cli: rework printing of general active-connection properties 2018-06-01 16:03:23 +02:00
devices.c tests: improve NetworkManager stub service for Wi-Fi scanning 2018-06-18 10:56:50 +02:00
devices.h cli: use a palette to implement coloring 2018-05-10 14:36:58 +02:00
general.c cli: spawn pager on "nmcli c" and "nmcli g permsisions" 2018-06-11 10:28:50 +02:00
general.h cli: output a short summary of devices when called without arguments 2016-07-19 14:29:05 +02:00
meson.build build: unifiy specifying locale directory define 2018-05-31 15:59:38 +02:00
nmcli-completion cli: make nmcli do its own command completion 2017-02-13 16:32:15 +01:00
nmcli.c cli: rework check-colors to first evaluate enabled/disabled 2018-06-26 11:32:39 +02:00
nmcli.h cli: avoid passing NmCli to set_color() functions 2018-06-26 11:32:39 +02:00
polkit-agent.c cli: rework callbacks in NMPolkitListener to use one vtable structure 2018-04-16 16:03:14 +02:00
polkit-agent.h cli: add 'nmcli agent' command (bgo #739568) 2014-11-07 11:58:25 +01:00
settings.c all: use the elvis operator wherever possible 2018-05-10 14:36:58 +02:00
settings.h cli: move setting creation to meta data 2017-04-12 14:12:20 +02:00
utils.c cli: fix printing multi-line output when there is nothing to print 2018-06-15 11:48:16 +02:00
utils.h cli: add connection FILENAME field 2018-06-11 15:09:30 +02:00