diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 6160b94f36..a7e71c705b 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -245,232 +245,222 @@ static char *gen_connection_types (const char *text, int state); static void usage (void) { - fprintf (stderr, - _("Usage: nmcli connection { COMMAND | help }\n\n" - "COMMAND := { show | up | down | add | modify | edit | delete | reload | load }\n\n" - " show [--active] [[id | uuid | path | apath] ] ...\n\n" + g_printerr (_("Usage: nmcli connection { COMMAND | help }\n\n" + "COMMAND := { show | up | down | add | modify | edit | delete | reload | load }\n\n" + " show [--active] [[id | uuid | path | apath] ] ...\n\n" #if WITH_WIMAX - " up [[id | uuid | path] ] [ifname ] [ap ] [nsp ]\n\n" + " up [[id | uuid | path] ] [ifname ] [ap ] [nsp ]\n\n" #else - " up [[id | uuid | path] ] [ifname ] [ap ]\n\n" + " up [[id | uuid | path] ] [ifname ] [ap ]\n\n" #endif - " down [id | uuid | path | apath] \n\n" - " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n\n" - " modify [--temporary] [id | uuid | path] ([+|-]. )+\n\n" - " edit [id | uuid | path] \n" - " edit [type ] [con-name ]\n\n" - " delete [id | uuid | path] \n\n" - " reload\n\n" - " load [ ... ]\n\n")); + " down [id | uuid | path | apath] \n\n" + " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n\n" + " modify [--temporary] [id | uuid | path] ([+|-]. )+\n\n" + " edit [id | uuid | path] \n" + " edit [type ] [con-name ]\n\n" + " delete [id | uuid | path] \n\n" + " reload\n\n" + " load [ ... ]\n\n")); } static void usage_connection_show (void) { - fprintf (stderr, - _("Usage: nmcli connection show { ARGUMENTS | help }\n" - "\n" - "ARGUMENTS := [--active]\n" - "\n" - "List in-memory and on-disk connection profiles, some of which may also be\n" - "active if a device is using that connection profile. Without a parameter, all\n" - "profiles are listed. When --active option is specified, only the active\n" - "profiles are shown.\n" - "\n" - "ARGUMENTS := [--active] [id | uuid | path | apath] ...\n" - "\n" - "Show details for specified connections. By default, both static configuration\n" - "and active connection data are displayed. It is possible to filter the output\n" - "using global '--fields' option. Refer to the manual page for more information.\n" - "When --active option is specified, only the active profiles are taken into\n" - "account.\n")); + g_printerr (_("Usage: nmcli connection show { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [--active]\n" + "\n" + "List in-memory and on-disk connection profiles, some of which may also be\n" + "active if a device is using that connection profile. Without a parameter, all\n" + "profiles are listed. When --active option is specified, only the active\n" + "profiles are shown.\n" + "\n" + "ARGUMENTS := [--active] [id | uuid | path | apath] ...\n" + "\n" + "Show details for specified connections. By default, both static configuration\n" + "and active connection data are displayed. It is possible to filter the output\n" + "using global '--fields' option. Refer to the manual page for more information.\n" + "When --active option is specified, only the active profiles are taken into\n" + "account.\n")); } static void usage_connection_up (void) { - fprintf (stderr, - _("Usage: nmcli connection up { ARGUMENTS | help }\n" - "\n" - "ARGUMENTS := [id | uuid | path] [ifname ] [ap ] [nsp ]\n" - "\n" - "Activate a connection on a device. The profile to activate is identified by its\n" - "name, UUID or D-Bus path.\n" - "\n" - "ARGUMENTS := ifname [ap ] [nsp ]\n" - "\n" - "Activate a device with a connection. The connection profile is selected\n" - "automatically by NetworkManager.\n" - "\n" - "ifname - specifies the device to active the connection on\n" - "ap - specifies AP to connect to (only valid for Wi-Fi)\n" - "nsp - specifies NSP to connect to (only valid for WiMAX)\n\n")); + g_printerr (_("Usage: nmcli connection up { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [id | uuid | path] [ifname ] [ap ] [nsp ]\n" + "\n" + "Activate a connection on a device. The profile to activate is identified by its\n" + "name, UUID or D-Bus path.\n" + "\n" + "ARGUMENTS := ifname [ap ] [nsp ]\n" + "\n" + "Activate a device with a connection. The connection profile is selected\n" + "automatically by NetworkManager.\n" + "\n" + "ifname - specifies the device to active the connection on\n" + "ap - specifies AP to connect to (only valid for Wi-Fi)\n" + "nsp - specifies NSP to connect to (only valid for WiMAX)\n\n")); } static void usage_connection_down (void) { - fprintf (stderr, - _("Usage: nmcli connection down { ARGUMENTS | help }\n" - "\n" - "ARGUMENTS := [id | uuid | path | apath] \n" - "\n" - "Deactivate a connection from a device (without preventing the device from\n" - "further auto-activation). The profile to deactivate is identified by its name,\n" - "UUID or D-Bus path.\n\n")); + g_printerr (_("Usage: nmcli connection down { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [id | uuid | path | apath] \n" + "\n" + "Deactivate a connection from a device (without preventing the device from\n" + "further auto-activation). The profile to deactivate is identified by its name,\n" + "UUID or D-Bus path.\n\n")); } static void usage_connection_add (void) { - fprintf (stderr, - _("Usage: nmcli connection add { ARGUMENTS | help }\n" - "\n" - "ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n\n" - " COMMON_OPTIONS:\n" - " type \n" - " ifname | \"*\"\n" - " [con-name ]\n" - " [autoconnect yes|no]\n\n" - " [save yes|no]\n\n" - " TYPE_SPECIFIC_OPTIONS:\n" - " ethernet: [mac ]\n" - " [cloned-mac ]\n" - " [mtu ]\n\n" - " wifi: ssid \n" - " [mac ]\n" - " [cloned-mac ]\n" - " [mtu ]\n\n" - " wimax: [mac ]\n" - " [nsp ]\n\n" - " pppoe: username \n" - " [password ]\n" - " [service ]\n" - " [mtu ]\n" - " [mac ]\n\n" - " gsm: apn \n" - " [user ]\n" - " [password ]\n\n" - " cdma: [user ]\n" - " [password ]\n\n" - " infiniband: [mac ]\n" - " [mtu ]\n" - " [transport-mode datagram | connected]\n" - " [parent ]\n" - " [p-key ]\n\n" - " bluetooth: [addr ]\n" - " [bt-type panu|dun-gsm|dun-cdma]\n\n" - " vlan: dev \n" - " id \n" - " [flags ]\n" - " [ingress ]\n" - " [egress ]\n" - " [mtu ]\n\n" - " bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) | broadcast (3) |\n" - " 802.3ad (4) | balance-tlb (5) | balance-alb (6)]\n" - " [primary ]\n" - " [miimon ]\n" - " [downdelay ]\n" - " [updelay ]\n" - " [arp-interval ]\n" - " [arp-ip-target ]\n\n" - " bond-slave: master \n\n" - " team: [config |]\n\n" - " team-slave: master \n" - " [config |]\n\n" - " bridge: [stp yes|no]\n" - " [priority ]\n" - " [forward-delay <2-30>]\n" - " [hello-time <1-10>]\n" - " [max-age <6-40>]\n" - " [ageing-time <0-1000000>]\n" - " [mac ]\n\n" - " bridge-slave: master \n" - " [priority <0-63>]\n" - " [path-cost <1-65535>]\n" - " [hairpin yes|no]\n\n" - " vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|...\n" - " [user ]\n\n" - " olpc-mesh: ssid \n" - " [channel <1-13>]\n" - " [dhcp-anycast ]\n\n" - " IP_OPTIONS:\n" - " [ip4 ] [gw4 ]\n" - " [ip6 ] [gw6 ]\n\n")); + g_printerr (_("Usage: nmcli connection add { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n\n" + " COMMON_OPTIONS:\n" + " type \n" + " ifname | \"*\"\n" + " [con-name ]\n" + " [autoconnect yes|no]\n\n" + " [save yes|no]\n\n" + " TYPE_SPECIFIC_OPTIONS:\n" + " ethernet: [mac ]\n" + " [cloned-mac ]\n" + " [mtu ]\n\n" + " wifi: ssid \n" + " [mac ]\n" + " [cloned-mac ]\n" + " [mtu ]\n\n" + " wimax: [mac ]\n" + " [nsp ]\n\n" + " pppoe: username \n" + " [password ]\n" + " [service ]\n" + " [mtu ]\n" + " [mac ]\n\n" + " gsm: apn \n" + " [user ]\n" + " [password ]\n\n" + " cdma: [user ]\n" + " [password ]\n\n" + " infiniband: [mac ]\n" + " [mtu ]\n" + " [transport-mode datagram | connected]\n" + " [parent ]\n" + " [p-key ]\n\n" + " bluetooth: [addr ]\n" + " [bt-type panu|dun-gsm|dun-cdma]\n\n" + " vlan: dev \n" + " id \n" + " [flags ]\n" + " [ingress ]\n" + " [egress ]\n" + " [mtu ]\n\n" + " bond: [mode balance-rr (0) | active-backup (1) | balance-xor (2) | broadcast (3) |\n" + " 802.3ad (4) | balance-tlb (5) | balance-alb (6)]\n" + " [primary ]\n" + " [miimon ]\n" + " [downdelay ]\n" + " [updelay ]\n" + " [arp-interval ]\n" + " [arp-ip-target ]\n\n" + " bond-slave: master \n\n" + " team: [config |]\n\n" + " team-slave: master \n" + " [config |]\n\n" + " bridge: [stp yes|no]\n" + " [priority ]\n" + " [forward-delay <2-30>]\n" + " [hello-time <1-10>]\n" + " [max-age <6-40>]\n" + " [ageing-time <0-1000000>]\n" + " [mac ]\n\n" + " bridge-slave: master \n" + " [priority <0-63>]\n" + " [path-cost <1-65535>]\n" + " [hairpin yes|no]\n\n" + " vpn: vpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|...\n" + " [user ]\n\n" + " olpc-mesh: ssid \n" + " [channel <1-13>]\n" + " [dhcp-anycast ]\n\n" + " IP_OPTIONS:\n" + " [ip4 ] [gw4 ]\n" + " [ip6 ] [gw6 ]\n\n")); } static void usage_connection_modify (void) { - fprintf (stderr, - _("Usage: nmcli connection modify { ARGUMENTS | help }\n" - "\n" - "ARGUMENTS := [id | uuid | path] ([+|-]. )+\n" - "\n" - "Modify one or more properties of the connection profile.\n" - "The profile is identified by its name, UUID or D-Bus path. For multi-valued\n" - "properties you can use optional '+' or '-' prefix to the property name.\n" - "The '+' sign allows appending items instead of overwriting the whole value.\n" - "The '-' sign allows removing selected items instead of the whole value.\n" - "\n" - "Examples:\n" - "nmcli con mod home-wifi wifi.ssid rakosnicek\n" - "nmcli con mod em1-1 ipv4.method manual ipv4.addr \"192.168.1.2/24, 10.10.1.5/8\"\n" - "nmcli con mod em1-1 +ipv4.dns 8.8.4.4\n" - "nmcli con mod em1-1 -ipv4.dns 1\n" - "nmcli con mod em1-1 -ipv6.addr \"abbe::cafe/56\"\n" - "nmcli con mod bond0 +bond.options mii=500\n" - "nmcli con mod bond0 -bond.options downdelay\n\n")); + g_printerr (_("Usage: nmcli connection modify { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [id | uuid | path] ([+|-]. )+\n" + "\n" + "Modify one or more properties of the connection profile.\n" + "The profile is identified by its name, UUID or D-Bus path. For multi-valued\n" + "properties you can use optional '+' or '-' prefix to the property name.\n" + "The '+' sign allows appending items instead of overwriting the whole value.\n" + "The '-' sign allows removing selected items instead of the whole value.\n" + "\n" + "Examples:\n" + "nmcli con mod home-wifi wifi.ssid rakosnicek\n" + "nmcli con mod em1-1 ipv4.method manual ipv4.addr \"192.168.1.2/24, 10.10.1.5/8\"\n" + "nmcli con mod em1-1 +ipv4.dns 8.8.4.4\n" + "nmcli con mod em1-1 -ipv4.dns 1\n" + "nmcli con mod em1-1 -ipv6.addr \"abbe::cafe/56\"\n" + "nmcli con mod bond0 +bond.options mii=500\n" + "nmcli con mod bond0 -bond.options downdelay\n\n")); } static void usage_connection_edit (void) { - fprintf (stderr, - _("Usage: nmcli connection edit { ARGUMENTS | help }\n" - "\n" - "ARGUMENTS := [id | uuid | path] \n" - "\n" - "Edit an existing connection profile in an interactive editor.\n" - "The profile is identified by its name, UUID or D-Bus path\n" - "\n" - "ARGUMENTS := [type ] [con-name ]\n" - "\n" - "Add a new connection profile in an interactive editor.\n\n")); + g_printerr (_("Usage: nmcli connection edit { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [id | uuid | path] \n" + "\n" + "Edit an existing connection profile in an interactive editor.\n" + "The profile is identified by its name, UUID or D-Bus path\n" + "\n" + "ARGUMENTS := [type ] [con-name ]\n" + "\n" + "Add a new connection profile in an interactive editor.\n\n")); } static void usage_connection_delete (void) { - fprintf (stderr, - _("Usage: nmcli connection delete { ARGUMENTS | help }\n" - "\n" - "ARGUMENTS := [id | uuid | path] \n" - "\n" - "Delete a connection profile.\n" - "The profile is identified by its name, UUID or D-Bus path.\n\n")); + g_printerr (_("Usage: nmcli connection delete { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [id | uuid | path] \n" + "\n" + "Delete a connection profile.\n" + "The profile is identified by its name, UUID or D-Bus path.\n\n")); } static void usage_connection_reload (void) { - fprintf (stderr, - _("Usage: nmcli connection reload { help }\n" - "\n" - "Reload all connection files from disk.\n\n")); + g_printerr (_("Usage: nmcli connection reload { help }\n" + "\n" + "Reload all connection files from disk.\n\n")); } static void usage_connection_load (void) { - fprintf (stderr, - _("Usage: nmcli connection load { ARGUMENTS | help }\n" - "\n" - "ARGUMENTS := [...]\n" - "\n" - "Load/reload one or more connection files from disk. Use this after manually\n" - "editing a connection file to ensure that NetworkManager is aware of its latest\n" - "state.\n\n")); + g_printerr (_("Usage: nmcli connection load { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [...]\n" + "\n" + "Load/reload one or more connection files from disk. Use this after manually\n" + "editing a connection file to ensure that NetworkManager is aware of its latest\n" + "state.\n\n")); } static gboolean @@ -682,7 +672,7 @@ nmc_connection_profile_details (NMConnection *connection, NmCli *nmc) const char *prop_name = (const char *) g_ptr_array_index (prop_array, i); if (nmc->print_output != NMC_PRINT_TERSE && !nmc->multiline_output && was_output) - printf ("\n"); /* Empty line */ + g_print ("\n"); /* Empty line */ was_output = FALSE; @@ -1033,7 +1023,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc) char *group_fld = (char *) g_ptr_array_index (group_fields, i); if (nmc->print_output != NMC_PRINT_TERSE && !nmc->multiline_output && was_output) - printf ("\n"); /* Empty line */ + g_print ("\n"); /* Empty line */ was_output = FALSE; @@ -1376,7 +1366,7 @@ do_connections_show (NmCli *nmc, gboolean active_only, int argc, char **argv) /* Show an empty line between connections */ if (new_line) - printf ("\n"); + g_print ("\n"); /* Show profile configuration */ if (without_fields || profile_flds) { @@ -1648,15 +1638,15 @@ device_state_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data) if (ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { if (nmc->print_output == NMC_PRINT_PRETTY) nmc_terminal_erase_line (); - printf (_("Connection successfully activated (D-Bus active path: %s)\n"), - nm_object_get_path (NM_OBJECT (active))); + g_print (_("Connection successfully activated (D-Bus active path: %s)\n"), + nm_object_get_path (NM_OBJECT (active))); quit (); } else if ( ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING && state == NM_DEVICE_STATE_IP_CONFIG) { if (nmc->print_output == NMC_PRINT_PRETTY) nmc_terminal_erase_line (); - printf (_("Connection successfully activated (master waiting for slaves) (D-Bus active path: %s)\n"), - nm_object_get_path (NM_OBJECT (active))); + g_print (_("Connection successfully activated (master waiting for slaves) (D-Bus active path: %s)\n"), + nm_object_get_path (NM_OBJECT (active))); quit (); } else if (ac_state != NM_ACTIVE_CONNECTION_STATE_ACTIVATING) { g_string_printf (nmc->return_text, _("Error: Connection activation failed.")); @@ -1676,8 +1666,8 @@ active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, gpoin if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { if (nmc->print_output == NMC_PRINT_PRETTY) nmc_terminal_erase_line (); - printf (_("Connection successfully activated (D-Bus active path: %s)\n"), - nm_object_get_path (NM_OBJECT (active))); + g_print (_("Connection successfully activated (D-Bus active path: %s)\n"), + nm_object_get_path (NM_OBJECT (active))); g_object_unref (active); quit (); } else if ( state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED @@ -1726,8 +1716,8 @@ vpn_connection_state_cb (NMVpnConnection *vpn, case NM_VPN_CONNECTION_STATE_ACTIVATED: if (nmc->print_output == NMC_PRINT_PRETTY) nmc_terminal_erase_line (); - printf (_("VPN connection successfully activated (D-Bus active path: %s)\n"), - nm_object_get_path (NM_OBJECT (vpn))); + g_print (_("VPN connection successfully activated (D-Bus active path: %s)\n"), + nm_object_get_path (NM_OBJECT (vpn))); g_object_unref (vpn); quit (); break; @@ -1830,8 +1820,8 @@ activate_connection_cb (GObject *client, GAsyncResult *result, gpointer user_dat if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { if (nmc->print_output == NMC_PRINT_PRETTY) nmc_terminal_erase_line (); - printf (_("Connection successfully activated (D-Bus active path: %s)\n"), - nm_object_get_path (NM_OBJECT (active))); + g_print (_("Connection successfully activated (D-Bus active path: %s)\n"), + nm_object_get_path (NM_OBJECT (active))); } g_object_unref (active); quit (); @@ -1993,8 +1983,8 @@ do_connection_up (NmCli *nmc, int argc, char **argv) nsp = *argv; } #endif - else { - fprintf (stderr, _("Unknown parameter: %s\n"), *argv); + else { + g_printerr (_("Unknown parameter: %s\n"), *argv); } argc--; @@ -2816,9 +2806,9 @@ want_provide_opt_args (const char *type, int num) gboolean ret = TRUE; /* Ask for optional arguments. */ - printf (ngettext ("There is %d optional argument for '%s' connection type.\n", - "There are %d optional arguments for '%s' connection type.\n", num), - num, type); + g_print (ngettext ("There is %d optional argument for '%s' connection type.\n", + "There are %d optional arguments for '%s' connection type.\n", num), + num, type); answer = nmc_readline (ngettext ("Do you want to provide it? %s", "Do you want to provide them? %s", num), prompt_yes_no (TRUE, NULL)); @@ -2845,7 +2835,7 @@ do_questionnaire_ethernet (gboolean ethernet, char **mtu, char **mac, char **clo *mtu = nmc_readline (_("MTU [auto]: ")); once_more = !check_and_convert_mtu (*mtu, NULL, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*mtu); } @@ -2856,7 +2846,7 @@ do_questionnaire_ethernet (gboolean ethernet, char **mtu, char **mac, char **clo *mac = nmc_readline (_("MAC [none]: ")); once_more = !check_mac (*mac, ARPHRD_ETHER, "mac", &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*mac); } @@ -2867,7 +2857,7 @@ do_questionnaire_ethernet (gboolean ethernet, char **mtu, char **mac, char **clo *cloned_mac = nmc_readline (_("Cloned MAC [none]: ")); once_more = !check_mac (*cloned_mac, ARPHRD_ETHER, "cloned-mac", &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*cloned_mac); } @@ -2893,7 +2883,7 @@ do_questionnaire_infiniband (char **mtu, char **mac, char **mode, char **parent, *mtu = nmc_readline (_("MTU [auto]: ")); once_more = !check_and_convert_mtu (*mtu, NULL, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*mtu); } @@ -2904,7 +2894,7 @@ do_questionnaire_infiniband (char **mtu, char **mac, char **mode, char **parent, *mac = nmc_readline (_("MAC [none]: ")); once_more = !check_mac (*mac, ARPHRD_INFINIBAND, "mac", &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*mac); } @@ -2917,7 +2907,7 @@ do_questionnaire_infiniband (char **mtu, char **mac, char **mode, char **parent, *mode = g_strdup ("datagram"); once_more = !check_infiniband_mode (mode, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*mode); } @@ -2928,7 +2918,7 @@ do_questionnaire_infiniband (char **mtu, char **mac, char **mode, char **parent, *parent = nmc_readline (_("Parent interface [none]: ")); once_more = !check_infiniband_parent (*parent, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*parent); } @@ -2939,14 +2929,14 @@ do_questionnaire_infiniband (char **mtu, char **mac, char **mode, char **parent, *p_key = nmc_readline (_("P_KEY [none]: ")); once_more = !check_infiniband_p_key (*p_key, NULL, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*p_key); } /* If parent is specified, so has to be P_KEY */ if (!once_more && *parent && !*p_key) { once_more = TRUE; - printf (_("Error: 'p-key' is mandatory when 'parent' is specified.\n")); + g_print (_("Error: 'p-key' is mandatory when 'parent' is specified.\n")); } } while (once_more); } @@ -2974,7 +2964,7 @@ do_questionnaire_wimax (char **mac) *mac = nmc_readline (_("MAC [none]: ")); once_more = !check_mac (*mac, ARPHRD_ETHER, "mac", &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*mac); } @@ -3002,7 +2992,7 @@ do_questionnaire_pppoe (char **password, char **service, char **mtu, char **mac) *mtu = nmc_readline (_("MTU [auto]: ")); once_more = !check_and_convert_mtu (*mtu, NULL, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*mtu); } @@ -3013,7 +3003,7 @@ do_questionnaire_pppoe (char **password, char **service, char **mtu, char **mac) *mac = nmc_readline (_("MAC [none]: ")); once_more = !check_mac (*mac, ARPHRD_ETHER, "mac", &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*mac); } @@ -3057,7 +3047,7 @@ do_questionnaire_bluetooth (char **bt_type) tmp = nmc_string_is_valid (*bt_type, types, NULL); once_more = !tmp; if (once_more) { - printf (_("Error: 'bt-type': '%s' is not a valid bluetooth type.\n"), *bt_type); + g_print (_("Error: 'bt-type': '%s' is not a valid bluetooth type.\n"), *bt_type); g_free (*bt_type); } } while (once_more); @@ -3081,7 +3071,7 @@ do_questionnaire_vlan (char **mtu, char **flags, char **ingress, char **egress) *mtu = nmc_readline (_("MTU [auto]: ")); once_more = !check_and_convert_mtu (*mtu, NULL, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*mtu); } @@ -3092,7 +3082,7 @@ do_questionnaire_vlan (char **mtu, char **flags, char **ingress, char **egress) *flags = nmc_readline (_("VLAN flags (<0-7>) [none]: ")); once_more = !check_and_convert_vlan_flags (*flags, NULL, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*flags); } @@ -3103,7 +3093,7 @@ do_questionnaire_vlan (char **mtu, char **flags, char **ingress, char **egress) *ingress = nmc_readline (_("Ingress priority maps [none]: ")); once_more = !check_and_convert_vlan_prio_maps (*ingress, NM_VLAN_INGRESS_MAP, NULL, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*ingress); } @@ -3114,7 +3104,7 @@ do_questionnaire_vlan (char **mtu, char **flags, char **ingress, char **egress) *egress = nmc_readline (_("Egress priority maps [none]: ")); once_more = !check_and_convert_vlan_prio_maps (*egress, NM_VLAN_EGRESS_MAP, NULL, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*egress); } @@ -3151,7 +3141,7 @@ do_questionnaire_bond (char **mode, char **primary, char **miimon, if (mode_tmp) { *mode = g_strdup (mode_tmp); } else { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); } } while (!mode_tmp); @@ -3162,8 +3152,8 @@ do_questionnaire_bond (char **mode, char **primary, char **miimon, *primary = nmc_readline (_("Bonding primary interface [none]: ")); once_more = *primary && !nm_utils_iface_valid_name (*primary); if (once_more) { - printf (_("Error: 'primary': '%s' is not a valid interface name.\n"), - *primary); + g_print (_("Error: 'primary': '%s' is not a valid interface name.\n"), + *primary); g_free (*primary); } } while (once_more); @@ -3176,8 +3166,8 @@ do_questionnaire_bond (char **mode, char **primary, char **miimon, g_strstrip (monitor_mode); once_more = matches (monitor_mode, WORD_MIIMON) != 0 && matches (monitor_mode, WORD_ARP) != 0; if (once_more) { - printf (_("Error: '%s' is not a valid monitoring mode; use '%s' or '%s'.\n"), - monitor_mode, WORD_MIIMON, WORD_ARP); + g_print (_("Error: '%s' is not a valid monitoring mode; use '%s' or '%s'.\n"), + monitor_mode, WORD_MIIMON, WORD_ARP); g_free (monitor_mode); } } while (once_more); @@ -3188,8 +3178,8 @@ do_questionnaire_bond (char **mode, char **primary, char **miimon, *miimon = nmc_readline (_("Bonding miimon [100]: ")); once_more = *miimon && !nmc_string_to_uint (*miimon, TRUE, 0, G_MAXUINT32, &tmp); if (once_more) { - printf (_("Error: 'miimon': '%s' is not a valid number <0-%u>.\n"), - *miimon, G_MAXUINT32); + g_print (_("Error: 'miimon': '%s' is not a valid number <0-%u>.\n"), + *miimon, G_MAXUINT32); g_free (*miimon); } } while (once_more); @@ -3199,8 +3189,8 @@ do_questionnaire_bond (char **mode, char **primary, char **miimon, *downdelay = nmc_readline (_("Bonding downdelay [0]: ")); once_more = *downdelay && !nmc_string_to_uint (*downdelay, TRUE, 0, G_MAXUINT32, &tmp); if (once_more) { - printf (_("Error: 'downdelay': '%s' is not a valid number <0-%u>.\n"), - *downdelay, G_MAXUINT32); + g_print (_("Error: 'downdelay': '%s' is not a valid number <0-%u>.\n"), + *downdelay, G_MAXUINT32); g_free (*downdelay); } } while (once_more); @@ -3210,8 +3200,8 @@ do_questionnaire_bond (char **mode, char **primary, char **miimon, *updelay = nmc_readline (_("Bonding updelay [0]: ")); once_more = *updelay && !nmc_string_to_uint (*updelay, TRUE, 0, G_MAXUINT32, &tmp); if (once_more) { - printf (_("Error: 'updelay': '%s' is not a valid number <0-%u>.\n"), - *updelay, G_MAXUINT32); + g_print (_("Error: 'updelay': '%s' is not a valid number <0-%u>.\n"), + *updelay, G_MAXUINT32); g_free (*updelay); } } while (once_more); @@ -3222,8 +3212,8 @@ do_questionnaire_bond (char **mode, char **primary, char **miimon, *arpinterval = nmc_readline (_("Bonding arp-interval [0]: ")); once_more = *arpinterval && !nmc_string_to_uint (*arpinterval, TRUE, 0, G_MAXUINT32, &tmp); if (once_more) { - printf (_("Error: 'arp-interval': '%s' is not a valid number <0-%u>.\n"), - *arpinterval, G_MAXUINT32); + g_print (_("Error: 'arp-interval': '%s' is not a valid number <0-%u>.\n"), + *arpinterval, G_MAXUINT32); g_free (*arpinterval); } } while (once_more); @@ -3253,7 +3243,7 @@ do_questionnaire_team_common (const char *type_name, char **config) *config = nmc_readline (_("Team JSON configuration [none]: ")); once_more = !nmc_team_check_config (*config, &json, &error); if (once_more) { - printf ("Error: %s\n", error->message); + g_print ("Error: %s\n", error->message); g_clear_error (&error); g_free (*config); } @@ -3296,7 +3286,7 @@ do_questionnaire_bridge (char **stp, char **priority, char **fwd_delay, char **h normalize_yes_no (stp); once_more = !nmc_string_to_bool (*stp, &stp_bool, &error); if (once_more) { - printf (_("Error: 'stp': %s.\n"), error->message); + g_print (_("Error: 'stp': %s.\n"), error->message); g_clear_error (&error); g_free (*stp); } @@ -3308,8 +3298,8 @@ do_questionnaire_bridge (char **stp, char **priority, char **fwd_delay, char **h *priority = *priority ? *priority : g_strdup ("32768"); once_more = !nmc_string_to_uint (*priority, TRUE, 0, G_MAXUINT16, &tmp); if (once_more) { - printf (_("Error: 'priority': '%s' is not a valid number <0-%d>.\n"), - *priority, G_MAXUINT16); + g_print (_("Error: 'priority': '%s' is not a valid number <0-%d>.\n"), + *priority, G_MAXUINT16); g_free (*priority); } } while (once_more); @@ -3320,8 +3310,8 @@ do_questionnaire_bridge (char **stp, char **priority, char **fwd_delay, char **h *fwd_delay = *fwd_delay ? *fwd_delay : g_strdup ("15"); once_more = !nmc_string_to_uint (*fwd_delay, TRUE, 2, 30, &tmp); if (once_more) { - printf (_("Error: 'forward-delay': '%s' is not a valid number <2-30>.\n"), - *fwd_delay); + g_print (_("Error: 'forward-delay': '%s' is not a valid number <2-30>.\n"), + *fwd_delay); g_free (*fwd_delay); } } while (once_more); @@ -3333,8 +3323,8 @@ do_questionnaire_bridge (char **stp, char **priority, char **fwd_delay, char **h *hello_time = *hello_time ? *hello_time : g_strdup ("2"); once_more = !nmc_string_to_uint (*hello_time, TRUE, 1, 10, &tmp); if (once_more) { - printf (_("Error: 'hello-time': '%s' is not a valid number <1-10>.\n"), - *hello_time); + g_print (_("Error: 'hello-time': '%s' is not a valid number <1-10>.\n"), + *hello_time); g_free (*hello_time); } } while (once_more); @@ -3345,8 +3335,8 @@ do_questionnaire_bridge (char **stp, char **priority, char **fwd_delay, char **h *max_age = *max_age ? *max_age : g_strdup ("20"); once_more = !nmc_string_to_uint (*max_age, TRUE, 6, 40, &tmp); if (once_more) { - printf (_("Error: 'max-age': '%s' is not a valid number <6-40>.\n"), - *max_age); + g_print (_("Error: 'max-age': '%s' is not a valid number <6-40>.\n"), + *max_age); g_free (*max_age); } } while (once_more); @@ -3357,8 +3347,8 @@ do_questionnaire_bridge (char **stp, char **priority, char **fwd_delay, char **h *ageing_time = *ageing_time ? *ageing_time : g_strdup ("300"); once_more = !nmc_string_to_uint (*ageing_time, TRUE, 0, 1000000, &tmp); if (once_more) { - printf (_("Error: 'ageing-time': '%s' is not a valid number <0-1000000>.\n"), - *ageing_time); + g_print (_("Error: 'ageing-time': '%s' is not a valid number <0-1000000>.\n"), + *ageing_time); g_free (*ageing_time); } } while (once_more); @@ -3368,7 +3358,7 @@ do_questionnaire_bridge (char **stp, char **priority, char **fwd_delay, char **h *mac = nmc_get_user_input (_("MAC [none]: ")); once_more = !check_mac (*mac, ARPHRD_ETHER, "mac", &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*mac); } @@ -3394,7 +3384,7 @@ do_questionnaire_bridge_slave (char **priority, char **path_cost, char **hairpin once_more = !bridge_prop_string_to_uint (*priority, "priority", NM_TYPE_SETTING_BRIDGE_PORT, NM_SETTING_BRIDGE_PORT_PRIORITY, &tmp, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*priority); } @@ -3407,7 +3397,7 @@ do_questionnaire_bridge_slave (char **priority, char **path_cost, char **hairpin once_more = !bridge_prop_string_to_uint (*path_cost, "path-cost", NM_TYPE_SETTING_BRIDGE_PORT, NM_SETTING_BRIDGE_PORT_PATH_COST, &tmp, &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*path_cost); } @@ -3421,7 +3411,7 @@ do_questionnaire_bridge_slave (char **priority, char **path_cost, char **hairpin normalize_yes_no (hairpin); once_more = !nmc_string_to_bool (*hairpin, &hairpin_bool, &error); if (once_more) { - printf (_("Error: 'hairpin': %s.\n"), error->message); + g_print (_("Error: 'hairpin': %s.\n"), error->message); g_clear_error (&error); g_free (*hairpin); } @@ -3456,8 +3446,8 @@ do_questionnaire_olpc (char **channel, char **dhcp_anycast) *channel = nmc_readline (_("OLPC Mesh channel [1]: ")); once_more = *channel && !nmc_string_to_uint (*channel, TRUE, 1, 13, &tmp); if (once_more) { - printf (_("Error: 'channel': '%s' is not a valid number <1-13>.\n"), - *channel); + g_print (_("Error: 'channel': '%s' is not a valid number <1-13>.\n"), + *channel); g_free (*channel); } } while (once_more); @@ -3467,7 +3457,7 @@ do_questionnaire_olpc (char **channel, char **dhcp_anycast) *dhcp_anycast = nmc_readline (_("DHCP anycast MAC address [none]: ")); once_more = !check_mac (*dhcp_anycast, ARPHRD_ETHER, "dhcp-anycast", &error); if (once_more) { - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); g_free (*dhcp_anycast); } @@ -3529,14 +3519,14 @@ ask_for_ip_addresses (NMConnection *connection, int family) added = add_ip6_address_to_connection ((NMIP6Address *) ipaddr, connection); gw = gw ? gw : (family == 4) ? "0.0.0.0" : "::"; if (added) - printf (_(" Address successfully added: %s %s\n"), ip, gw); + g_print (_(" Address successfully added: %s %s\n"), ip, gw); else - printf (_(" Warning: address already present: %s %s\n"), ip, gw); + g_print (_(" Warning: address already present: %s %s\n"), ip, gw); if (rest) - printf (_(" Warning: ignoring garbage at the end: '%s'\n"), rest); + g_print (_(" Warning: ignoring garbage at the end: '%s'\n"), rest); } else { g_prefix_error (&error, _("Error: ")); - printf ("%s\n", error->message); + g_print ("%s\n", error->message); g_clear_error (&error); } } else @@ -3559,7 +3549,7 @@ do_questionnaire_ip (NMConnection *connection) return; } - printf (_("Press to finish adding addresses.\n")); + g_print (_("Press to finish adding addresses.\n")); ask_for_ip_addresses (connection, 4); ask_for_ip_addresses (connection, 6); @@ -4305,11 +4295,11 @@ cleanup_bond: /* Verify master argument */ checked_master = verify_master_for_slave (all_connections, master, NM_SETTING_BOND_SETTING_NAME); if (!checked_master) - printf (_("Warning: master='%s' doesn't refer to any existing profile.\n"), master); + g_print (_("Warning: master='%s' doesn't refer to any existing profile.\n"), master); if (type) - printf (_("Warning: 'type' is currently ignored. " - "We only support ethernet slaves for now.\n")); + g_print (_("Warning: 'type' is currently ignored. " + "We only support ethernet slaves for now.\n")); /* Change properties in 'connection' setting */ g_object_set (s_con, @@ -4403,7 +4393,7 @@ cleanup_team: /* Verify master argument */ checked_master = verify_master_for_slave (all_connections, master, NM_SETTING_TEAM_SETTING_NAME); if (!checked_master) - printf (_("Warning: master='%s' doesn't refer to any existing profile.\n"), master); + g_print (_("Warning: master='%s' doesn't refer to any existing profile.\n"), master); /* Also ask for all optional arguments if '--ask' is specified. */ config = g_strdup (config_c); @@ -4411,8 +4401,8 @@ cleanup_team: do_questionnaire_team_slave (&config); if (type) - printf (_("Warning: 'type' is currently ignored. " - "We only support ethernet slaves for now.\n")); + g_print (_("Warning: 'type' is currently ignored. " + "We only support ethernet slaves for now.\n")); /* Add 'team-port' setting */ s_team_port = (NMSettingTeamPort *) nm_setting_team_port_new (); @@ -4605,11 +4595,11 @@ cleanup_bridge: /* Verify master argument */ checked_master = verify_master_for_slave (all_connections, master, NM_SETTING_BRIDGE_SETTING_NAME); if (!checked_master) - printf (_("Warning: master='%s' doesn't refer to any existing profile.\n"), master); + g_print (_("Warning: master='%s' doesn't refer to any existing profile.\n"), master); if (type) - printf (_("Warning: 'type' is currently ignored. " - "We only support ethernet slaves for now.\n")); + g_print (_("Warning: 'type' is currently ignored. " + "We only support ethernet slaves for now.\n")); /* Add 'bridge-port' setting */ /* Must be done *before* bridge_prop_string_to_uint() so that the type is known */ @@ -4695,7 +4685,7 @@ cleanup_bridge_slave: vpn_type = g_strstrip (vpn_type_ask); if (!(st = nmc_string_is_valid (vpn_type, nmc_known_vpns, NULL))) { - printf (_("Warning: 'vpn-type': %s not known.\n"), vpn_type); + g_print (_("Warning: 'vpn-type': %s not known.\n"), vpn_type); st = vpn_type; } service_type = g_strdup_printf ("%s.%s", NM_DBUS_INTERFACE, st); @@ -4894,9 +4884,9 @@ add_connection_cb (GObject *settings, g_error_free (error); nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; } else { - printf (_("Connection '%s' (%s) successfully added.\n"), - nm_connection_get_id (NM_CONNECTION (connection)), - nm_connection_get_uuid (NM_CONNECTION (connection))); + g_print (_("Connection '%s' (%s) successfully added.\n"), + nm_connection_get_id (NM_CONNECTION (connection)), + nm_connection_get_uuid (NM_CONNECTION (connection))); g_object_unref (connection); } @@ -5100,7 +5090,7 @@ do_connection_add (NmCli *nmc, int argc, char **argv) if (!type && nmc->ask) { char *types_tmp = get_valid_options_string (nmc_valid_connection_types); - printf ("Valid types: [%s]\n", types_tmp); + g_print ("Valid types: [%s]\n", types_tmp); type = type_ask = nmc_readline (PROMPT_CON_TYPE); g_free (types_tmp); } @@ -5865,7 +5855,7 @@ load_history_cmds (const char *uuid) kf = g_key_file_new (); if (!g_key_file_load_from_file (kf, filename, G_KEY_FILE_KEEP_COMMENTS, &err)) { if (err->code == G_KEY_FILE_ERROR_PARSE) - printf ("Warning: %s parse error: %s\n", filename, err->message); + g_print ("Warning: %s parse error: %s\n", filename, err->message); g_key_file_free (kf); g_free (filename); return; @@ -5901,7 +5891,7 @@ save_history_cmds (const char *uuid) if (!g_key_file_load_from_file (kf, filename, G_KEY_FILE_KEEP_COMMENTS, &err)) { if ( err->code != G_FILE_ERROR_NOENT && err->code != G_KEY_FILE_ERROR_NOT_FOUND) { - printf ("Warning: %s parse error: %s\n", filename, err->message); + g_print ("Warning: %s parse error: %s\n", filename, err->message); g_key_file_free (kf); g_free (filename); g_clear_error (&err); @@ -5948,8 +5938,8 @@ editor_show_connection (NMConnection *connection, NmCli *nmc) static void editor_show_setting (NMSetting *setting, NmCli *nmc) { - printf (_("['%s' setting values]\n"), - nm_setting_get_name (setting)); + g_print (_("['%s' setting values]\n"), + nm_setting_get_name (setting)); nmc->print_output = NMC_PRINT_NORMAL; nmc->multiline_output = TRUE; @@ -6026,24 +6016,24 @@ parse_editor_main_cmd (const char *cmd, char **cmd_arg) static void editor_main_usage (void) { - printf ("------------------------------------------------------------------------------\n"); + g_print ("------------------------------------------------------------------------------\n"); /* TRANSLATORS: do not translate command names and keywords before :: * However, you should translate terms enclosed in <>. */ - printf (_("---[ Main menu ]---\n" - "goto [ | ] :: go to a setting or property\n" - "remove [.] | :: remove setting or reset property value\n" - "set [. ] :: set property value\n" - "describe [.] :: describe property\n" - "print [all | [.]] :: print the connection\n" - "verify [all] :: verify the connection\n" - "save [persistent|temporary] :: save the connection\n" - "activate [] [/|] :: activate the connection\n" - "back :: go one level up (back)\n" - "help/? [] :: print this help\n" - "nmcli :: nmcli configuration\n" - "quit :: exit nmcli\n")); - printf ("------------------------------------------------------------------------------\n"); + g_print (_("---[ Main menu ]---\n" + "goto [ | ] :: go to a setting or property\n" + "remove [.] | :: remove setting or reset property value\n" + "set [. ] :: set property value\n" + "describe [.] :: describe property\n" + "print [all | [.]] :: print the connection\n" + "verify [all] :: verify the connection\n" + "save [persistent|temporary] :: save the connection\n" + "activate [] [/|] :: activate the connection\n" + "back :: go one level up (back)\n" + "help/? [] :: print this help\n" + "nmcli :: nmcli configuration\n" + "quit :: exit nmcli\n")); + g_print ("------------------------------------------------------------------------------\n"); } static void @@ -6057,92 +6047,92 @@ editor_main_help (const char *command) switch (cmd) { case NMC_EDITOR_MAIN_CMD_GOTO: - printf (_("goto [.] | :: enter setting/property for editing\n\n" - "This command enters into a setting or property for editing it.\n\n" - "Examples: nmcli> goto connection\n" - " nmcli connection> goto secondaries\n" - " nmcli> goto ipv4.addresses\n")); + g_print (_("goto [.] | :: enter setting/property for editing\n\n" + "This command enters into a setting or property for editing it.\n\n" + "Examples: nmcli> goto connection\n" + " nmcli connection> goto secondaries\n" + " nmcli> goto ipv4.addresses\n")); break; case NMC_EDITOR_MAIN_CMD_REMOVE: - printf (_("remove [.] :: remove setting or reset property value\n\n" - "This command removes an entire setting from the connection, or if a property\n" - "is given, resets that property to the default value.\n\n" - "Examples: nmcli> remove wifi-sec\n" - " nmcli> remove eth.mtu\n")); + g_print (_("remove [.] :: remove setting or reset property value\n\n" + "This command removes an entire setting from the connection, or if a property\n" + "is given, resets that property to the default value.\n\n" + "Examples: nmcli> remove wifi-sec\n" + " nmcli> remove eth.mtu\n")); break; case NMC_EDITOR_MAIN_CMD_SET: - printf (_("set [. ] :: set property value\n\n" - "This command sets property value.\n\n" - "Example: nmcli> set con.id My connection\n")); + g_print (_("set [. ] :: set property value\n\n" + "This command sets property value.\n\n" + "Example: nmcli> set con.id My connection\n")); break; case NMC_EDITOR_MAIN_CMD_DESCRIBE: - printf (_("describe [.] :: describe property\n\n" - "Shows property description. You can consult nm-settings(5) " - "manual page to see all NM settings and properties.\n")); + g_print (_("describe [.] :: describe property\n\n" + "Shows property description. You can consult nm-settings(5) " + "manual page to see all NM settings and properties.\n")); break; case NMC_EDITOR_MAIN_CMD_PRINT: - printf (_("print [all] :: print setting or connection values\n\n" - "Shows current property or the whole connection.\n\n" - "Example: nmcli ipv4> print all\n")); + g_print (_("print [all] :: print setting or connection values\n\n" + "Shows current property or the whole connection.\n\n" + "Example: nmcli ipv4> print all\n")); break; case NMC_EDITOR_MAIN_CMD_VERIFY: - printf (_("verify [all] :: verify setting or connection validity\n\n" - "Verifies whether the setting or connection is valid and can " - "be saved later. It indicates invalid values on error.\n\n" - "Examples: nmcli> verify\n" - " nmcli bond> verify\n")); + g_print (_("verify [all] :: verify setting or connection validity\n\n" + "Verifies whether the setting or connection is valid and can " + "be saved later. It indicates invalid values on error.\n\n" + "Examples: nmcli> verify\n" + " nmcli bond> verify\n")); break; case NMC_EDITOR_MAIN_CMD_SAVE: - printf (_("save [persistent|temporary] :: save the connection\n\n" - "Sends the connection profile to NetworkManager that either will save it\n" - "persistently, or will only keep it in memory. 'save' without an argument\n" - "means 'save persistent'.\n" - "Note that once you save the profile persistently those settings are saved\n" - "across reboot or restart. Subsequent changes can also be temporary or\n" - "persistent, but any temporary changes will not persist across reboot or\n" - "restart. If you want to fully remove the persistent connection, the connection\n" - "profile must be deleted.\n")); + g_print (_("save [persistent|temporary] :: save the connection\n\n" + "Sends the connection profile to NetworkManager that either will save it\n" + "persistently, or will only keep it in memory. 'save' without an argument\n" + "means 'save persistent'.\n" + "Note that once you save the profile persistently those settings are saved\n" + "across reboot or restart. Subsequent changes can also be temporary or\n" + "persistent, but any temporary changes will not persist across reboot or\n" + "restart. If you want to fully remove the persistent connection, the connection\n" + "profile must be deleted.\n")); break; case NMC_EDITOR_MAIN_CMD_ACTIVATE: - printf (_("activate [] [/|] :: activate the connection\n\n" - "Activates the connection.\n\n" - "Available options:\n" - " - device the connection will be activated on\n" - "/| - AP (Wi-Fi) or NSP (WiMAX) (prepend with / when is not specified)\n")); + g_print (_("activate [] [/|] :: activate the connection\n\n" + "Activates the connection.\n\n" + "Available options:\n" + " - device the connection will be activated on\n" + "/| - AP (Wi-Fi) or NSP (WiMAX) (prepend with / when is not specified)\n")); break; case NMC_EDITOR_MAIN_CMD_BACK: - printf (_("back :: go to upper menu level\n\n")); + g_print (_("back :: go to upper menu level\n\n")); break; case NMC_EDITOR_MAIN_CMD_HELP: - printf (_("help/? [] :: help for the nmcli commands\n\n")); + g_print (_("help/? [] :: help for the nmcli commands\n\n")); break; case NMC_EDITOR_MAIN_CMD_NMCLI: - printf (_("nmcli [ ] :: nmcli configuration\n\n" - "Configures nmcli. The following options are available:\n" - "status-line yes | no [default: no]\n" - "save-confirmation yes | no [default: yes]\n" - "prompt-color <0-8> [default: 0]\n" - " 0 = normal\n" - " 1 = \33[30mblack\33[0m\n" - " 2 = \33[31mred\33[0m\n" - " 3 = \33[32mgreen\33[0m\n" - " 4 = \33[33myellow\33[0m\n" - " 5 = \33[34mblue\33[0m\n" - " 6 = \33[35mmagenta\33[0m\n" - " 7 = \33[36mcyan\33[0m\n" - " 8 = \33[37mwhite\33[0m\n" - "\n" - "Examples: nmcli> nmcli status-line yes\n" - " nmcli> nmcli save-confirmation no\n" - " nmcli> nmcli prompt-color 3\n")); + g_print (_("nmcli [ ] :: nmcli configuration\n\n" + "Configures nmcli. The following options are available:\n" + "status-line yes | no [default: no]\n" + "save-confirmation yes | no [default: yes]\n" + "prompt-color <0-8> [default: 0]\n" + " 0 = normal\n" + " 1 = \33[30mblack\33[0m\n" + " 2 = \33[31mred\33[0m\n" + " 3 = \33[32mgreen\33[0m\n" + " 4 = \33[33myellow\33[0m\n" + " 5 = \33[34mblue\33[0m\n" + " 6 = \33[35mmagenta\33[0m\n" + " 7 = \33[36mcyan\33[0m\n" + " 8 = \33[37mwhite\33[0m\n" + "\n" + "Examples: nmcli> nmcli status-line yes\n" + " nmcli> nmcli save-confirmation no\n" + " nmcli> nmcli prompt-color 3\n")); break; case NMC_EDITOR_MAIN_CMD_QUIT: - printf (_("quit :: exit nmcli\n\n" - "This command exits nmcli. When the connection being edited " - "is not saved, the user is asked to confirm the action.\n")); + g_print (_("quit :: exit nmcli\n\n" + "This command exits nmcli. When the connection being edited " + "is not saved, the user is asked to confirm the action.\n")); break; default: - printf (_("Unknown command: '%s'\n"), command); + g_print (_("Unknown command: '%s'\n"), command); break; } } @@ -6204,21 +6194,21 @@ parse_editor_sub_cmd (const char *cmd, char **cmd_arg) static void editor_sub_help (void) { - printf ("------------------------------------------------------------------------------\n"); + g_print ("------------------------------------------------------------------------------\n"); /* TRANSLATORS: do not translate command names and keywords before :: * However, you should translate terms enclosed in <>. */ - printf (_("---[ Property menu ]---\n" - "set [] :: set new value\n" - "add [] :: add new option to the property\n" - "change :: change current value\n" - "remove [ |