summaryrefslogtreecommitdiff
path: root/cli/src/nmcli.h
Commit message (Collapse)AuthorAgeFilesLines
* cli: allow specifying 'group.name' syntax for '--fields'Jiří Klimeš2013-12-171-8/+9
| | | | | | | | | | | | | | | | | and use it for 'nmcli device show'. This allows filtering output not only for whole groups, but also for individual fields in commands that print data in groups (sections). Example: $ nmcli -f general.device,general.driver,ipv4,ipv6.address device show eth0 GENERAL.DEVICE: eth0 GENERAL.DRIVER: e1000e IP4.ADDRESS[1]: ip = 10.0.5.228/23, gw = 10.0.5.254 IP4.ADDRESS[2]: ip = 5.5.5.5/32, gw = 5.5.5.1 IP4.DNS[1]: 192.168.122.1 IP4.DNS[2]: 8.8.8.8 IP4.DOMAIN[1]: mycompany.com
* cli: add NMC_RESULT_ERROR_NOT_FOUND and use as appropriateDan Winship2013-11-221-1/+4
| | | | | | | This will allow callers to distinguish "no such connection" from "connection failed to activate", etc. https://bugzilla.redhat.com/show_bug.cgi?id=1022256
* cli: confirm connection saving when autoconnect=yes (rh #953296)Jiří Klimeš2013-07-301-0/+1
| | | | | | | | | Ask for confirmation in these cases: * autoconnect=yes and connection has not been saved yet * autoconnect=yes, but saved connection had autoconnect=no The confirmation can be switched off with nmcli> nmcli save-confirmation no
* cli: add 'nmcli' command for nmcli connection editor configurationJiří Klimeš2013-07-221-0/+14
| | | | | - show/hide status line: nmcli> nmcli status-line yes | no - editor prompt color: nmcli> nmcli prompt-color <0-8> (0 = normal/without color)
* cli: enhance printing to align tabular output properly and not to waste spaceJiří Klimeš2013-05-311-18/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now we have used a static width defined for each column for tabular output. Even if this worked in most cases, it was not optimal, because by using too wide columns we wasted space, and in case of a too narrow column the alignment broke. So, we need to know the longest string in a column to be able to align columns in the tabular output. Thus, the printing has to be postponed till we have all data available, and can find the widest column. This value is then used for aligning while printing the data. Arrays of NmcOutputField (rows) are inserted into output_data array. When all data have been added, print_data() can be used to print the whole output_data array with proper alignment. A single row can be printed using print_required_fields(). Also, output flags are redone to better match the new output_data array. The flags are needed for every row (in tabular output); they are stored in the first field (NmcOutputField) for the whole row. Addapted set_val_str() and set_val_arr() to set value type (char * x char **). Added set_val_strc(), set_val_arrc() for const values that should not be freed. output_data takes ownership of the data added to it and takes care of freeing the memory. See e.g. https://bugzilla.gnome.org/show_bug.cgi?id=699503
* cli: add '--ask' global optionJiří Klimeš2013-04-081-0/+1
| | | | It will be used to ask user for required but missing data/parameters.
* cli: make 'value' in NmcOutputField non constJiří Klimeš2013-03-261-1/+1
|
* cli: use an error quark for domain in g_set_error() instead of 0 (rh #842975)Jiří Klimeš2012-07-251-0/+4
| | | | | glib 2.32 makes a runtime check that domain is not NULL: GLib-WARNING **: (gerror.c:390):g_error_new_valist: runtime check failed: (domain != 0)
* cli: fix 'nmcli con delete' (rh #771258)Jiří Klimeš2012-01-101-2/+5
| | | | | | | The command didn't delete the connection, because nmcli exited before NM could check permissions (actually ConsoleKit didn't see the process). Now nmcli waits for "Removed" signal or D-Bus return (error) message on "Delete" method call.
* cli: allow field values to be null-terminated string arraysJiří Klimeš2012-01-031-10/+13
| | | | | | | Field values can now be string arrays. print_fields() recognizes the format and prints values accordingly. Setter functions was added to facilitate setting string vs. array: set_val_str(), set_val_arr()
* cli: compare nmcli and NM versionsJiří Klimeš2011-02-161-1/+5
| | | | | | nmcli gets NM version and compares it with its own and complains when they differ. This is to indicate that the results are not reliable, because the API could differ. '--nocheck' switches the checks off.
* Merge remote-tracking branch 'origin/rm-userset'Dan Williams2011-02-121-7/+1
|\ | | | | | | There; it's merged. Yay!
| * libnm-glib: merge nm-remote-settings{,-system}Daniel Gnoutcheff2010-08-061-2/+1
| | | | | | | | | | | | | | | | Originally, nm-remote-settings was used by the daemon to monitor the user settings service, and its subclass nm-remote-settings-system was used by NM clients to monitor the system settings service. With user settings services gone, this distinction is no longer needed. Simplify things a bit and merge the classes.
| * nmcli: remove user settings supportDaniel Gnoutcheff2010-08-061-5/+0
| | | | | | | | | | | | | | | | Remove all support for user settings services from nmcli. Update its manpage to reflect this. Manpage edits also anticipate changes to be made in regards to how secrets are managed.
* | cli: improve/add NM running checksJiří Klimeš2011-02-101-2/+5
|/ | | | | Check whether NetworkManager is running and return new error NMC_RESULT_ERROR_NM_NOT_RUNNING when appropriate.
* cli: wait a bit even when '--nowait' is specified; for permissions check (rh ↵Jiří Klimeš2010-07-291-0/+1
| | | | | | | #614866) NetworkManager checks clients' permissions on requests, so nmcli mustn't quit too early to give NM a chance to reach it on D-Bus.
* cli: multiline mode is default for 'dev list' and 'con list id|uuid'Jiří Klimeš2010-04-061-0/+1
| | | | | | | | Option '--multiline' was replaced with '--mode tabular|multiline'. It was neccessary to be able to switch to tabular output mode for 'dev list' and 'con list id|uuid' commands as they now print out in multiline mode by default. All other commands are in tabular mode by default.
* cli: 'dev list' adjustmentsJiří Klimeš2010-03-241-6/+8
| | | | | | | Modifications are mainly for multiline mode to ease parsing - each field name is prefixed with a section name. 'dev list' now also supports printing particular sections specifed via '--fields' option.
* cli: add NMC_RESULT_ERROR_USER_INPUT code for bad invocation of nmcliJiří Klimeš2010-03-241-7/+10
|
* cli: convert 'dev list' to new format; checking options validity for terseJiří Klimeš2010-03-221-5/+6
|
* cli: changing nmcli output to better fit both computer and human needsJiří Klimeš2010-03-181-14/+44
| | | | | | | | | | | | | The output is basically tabular with fields (columns) presenting specific pieces of info. Each line represents a single object. It's possible to switch to multiline output using '--multiline' option. In that mode single object is presented on more lines - each field on its line. Terse mode now uses ':' as field separator. It also escapes all occurences of ':' and '\' inside field values to ease parsing. The escaping behaviour can be controlled through '--escape' option. By default, escaping is switched on in tabular mode. When using terse mode ('--terse'), '--fields' option is mandatory for specifying required fields. That helps for flexibility and backwards compatibility. Not all output is converted yet.
* cli: add initial pieces of nmcliJirka Klimes2010-02-251-0/+77