summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-06-06 21:29:01 +0200
committerThomas Haller <thaller@redhat.com>2015-07-02 15:50:03 +0200
commit27bd7dc93846c0f403dc59a4d9f8a1f039c1382b (patch)
tree82d294956b2096eaa7b25ff163c59f9d640d7d95
parentf5177dbf7a06d691957f4aa506e0d7061ca3eec2 (diff)
downloadNetworkManager-27bd7dc93846c0f403dc59a4d9f8a1f039c1382b.tar.gz
config: change examples for command line arguments to system default
-rw-r--r--src/main.c4
-rw-r--r--src/nm-config.c12
-rw-r--r--src/nm-config.h1
-rw-r--r--src/nm-connectivity.c10
4 files changed, 13 insertions, 14 deletions
diff --git a/src/main.c b/src/main.c
index bfc441f4cf..1a8014f053 100644
--- a/src/main.c
+++ b/src/main.c
@@ -237,8 +237,8 @@ do_early_setup (int *argc, char **argv[], NMConfigCmdLineOptions *config_cli)
N_("Log domains separated by ',': any combination of [%s]"),
"PLATFORM,RFKILL,WIFI" },
{ "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &global_opt.g_fatal_warnings, N_("Make all warnings fatal"), NULL },
- { "pid-file", 'p', 0, G_OPTION_ARG_FILENAME, &global_opt.pidfile, N_("Specify the location of a PID file"), N_("filename") },
- { "state-file", 0, 0, G_OPTION_ARG_FILENAME, &global_opt.state_file, N_("State file location"), N_("/path/to/state.file") },
+ { "pid-file", 'p', 0, G_OPTION_ARG_FILENAME, &global_opt.pidfile, N_("Specify the location of a PID file"), N_(NM_DEFAULT_PID_FILE) },
+ { "state-file", 0, 0, G_OPTION_ARG_FILENAME, &global_opt.state_file, N_("State file location"), N_(NM_DEFAULT_SYSTEM_STATE_FILE) },
{ "run-from-build-dir", 0, 0, G_OPTION_ARG_NONE, &global_opt.run_from_build_dir, "Run from build directory", NULL },
{NULL}
};
diff --git a/src/nm-config.c b/src/nm-config.c
index c297318dbc..fccc4914b1 100644
--- a/src/nm-config.c
+++ b/src/nm-config.c
@@ -379,16 +379,16 @@ nm_config_cmd_line_options_add_to_entries (NMConfigCmdLineOptions *cli,
{
GOptionEntry config_options[] = {
- { "config", 0, 0, G_OPTION_ARG_FILENAME, &cli->config_main_file, N_("Config file location"), N_("/path/to/config.file") },
- { "config-dir", 0, 0, G_OPTION_ARG_FILENAME, &cli->config_dir, N_("Config directory location"), N_("/path/to/config/dir") },
- { "no-auto-default", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &cli->no_auto_default_file, "no-auto-default.state location", NULL },
- { "plugins", 0, 0, G_OPTION_ARG_STRING, &cli->plugins, N_("List of plugins separated by ','"), N_("plugin1,plugin2") },
+ { "config", 0, 0, G_OPTION_ARG_FILENAME, &cli->config_main_file, N_("Config file location"), N_(NM_DEFAULT_SYSTEM_CONF_FILE) },
+ { "config-dir", 0, 0, G_OPTION_ARG_FILENAME, &cli->config_dir, N_("Config directory location"), N_(NM_DEFAULT_SYSTEM_CONF_DIR) },
+ { "no-auto-default", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_FILENAME, &cli->no_auto_default_file, N_("State file for no-auto-default devices"), N_(NM_NO_AUTO_DEFAULT_STATE_FILE) },
+ { "plugins", 0, 0, G_OPTION_ARG_STRING, &cli->plugins, N_("List of plugins separated by ','"), N_(CONFIG_PLUGINS_DEFAULT) },
{ "configure-and-quit", 0, 0, G_OPTION_ARG_NONE, &cli->configure_and_quit, N_("Quit after initial configuration"), NULL },
/* These three are hidden for now, and should eventually just go away. */
{ "connectivity-uri", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &cli->connectivity_uri, N_("An http(s) address for checking internet connectivity"), "http://example.com" },
- { "connectivity-interval", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_INT, &cli->connectivity_interval, N_("The interval between connectivity checks (in seconds)"), "60" },
- { "connectivity-response", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &cli->connectivity_response, N_("The expected start of the response"), N_("Bingo!") },
+ { "connectivity-interval", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_INT, &cli->connectivity_interval, N_("The interval between connectivity checks (in seconds)"), G_STRINGIFY (NM_CONFIG_DEFAULT_CONNECTIVITY_INTERVAL) },
+ { "connectivity-response", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &cli->connectivity_response, N_("The expected start of the response"), N_(NM_CONFIG_DEFAULT_CONNECTIVITY_RESPONSE) },
{ 0 },
};
diff --git a/src/nm-config.h b/src/nm-config.h
index d4f5e94f3c..4eeb8aa886 100644
--- a/src/nm-config.h
+++ b/src/nm-config.h
@@ -44,6 +44,7 @@ G_BEGIN_DECLS
#define NM_CONFIG_SIGNAL_CONFIG_CHANGED "config-changed"
#define NM_CONFIG_DEFAULT_CONNECTIVITY_INTERVAL 300
+#define NM_CONFIG_DEFAULT_CONNECTIVITY_RESPONSE "NetworkManager is online" /* NOT LOCALIZED */
typedef struct NMConfigCmdLineOptions NMConfigCmdLineOptions;
diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c
index f7e7576c22..81ac8f9de4 100644
--- a/src/nm-connectivity.c
+++ b/src/nm-connectivity.c
@@ -37,8 +37,6 @@ G_DEFINE_TYPE (NMConnectivity, nm_connectivity, G_TYPE_OBJECT)
#define NM_CONNECTIVITY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CONNECTIVITY, NMConnectivityPrivate))
-#define DEFAULT_RESPONSE "NetworkManager is online" /* NOT LOCALIZED */
-
#define _LOG_DEFAULT_DOMAIN LOGD_CONCHECK
#define _LOG(level, domain, ...) \
@@ -140,7 +138,7 @@ nm_connectivity_check_cb (SoupSession *session, SoupMessage *msg, gpointer user_
NMConnectivityState new_state;
const char *nm_header;
const char *uri = cb_data->uri;
- const char *response = cb_data->response ? cb_data->response : DEFAULT_RESPONSE;
+ const char *response = cb_data->response ? cb_data->response : NM_CONFIG_DEFAULT_CONNECTIVITY_RESPONSE;
self = NM_CONNECTIVITY (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
/* it is safe to unref @self here, @simple holds yet another reference. */
@@ -401,7 +399,7 @@ set_property (GObject *object, guint property_id,
case PROP_RESPONSE:
response = g_value_get_string (value);
if (g_strcmp0 (response, priv->response) != 0) {
- /* a response %NULL means, DEFAULT_RESPONSE. Any other response
+ /* a response %NULL means, NM_CONFIG_DEFAULT_CONNECTIVITY_RESPONSE. Any other response
* (including "") is accepted. */
g_free (priv->response);
priv->response = g_strdup (response);
@@ -432,7 +430,7 @@ get_property (GObject *object, guint property_id,
if (priv->response)
g_value_set_string (value, priv->response);
else
- g_value_set_static_string (value, DEFAULT_RESPONSE);
+ g_value_set_static_string (value, NM_CONFIG_DEFAULT_CONNECTIVITY_RESPONSE);
break;
case PROP_STATE:
g_value_set_uint (value, priv->state);
@@ -510,7 +508,7 @@ nm_connectivity_class_init (NMConnectivityClass *klass)
g_object_class_install_property
(object_class, PROP_RESPONSE,
g_param_spec_string (NM_CONNECTIVITY_RESPONSE, "", "",
- DEFAULT_RESPONSE,
+ NM_CONFIG_DEFAULT_CONNECTIVITY_RESPONSE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));