356
357
gboolean wrote_pidfile = FALSE;
358
359
GOptionEntry options[] = {
359
{ "version", 0, 0, G_OPTION_ARG_NONE, &show_version, "Print NetworkManager version and exit", NULL },
360
{ "no-daemon", 0, 0, G_OPTION_ARG_NONE, &become_daemon, "Don't become a daemon", NULL },
361
{ "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &g_fatal_warnings, "Make all warnings fatal", NULL },
362
{ "pid-file", 0, 0, G_OPTION_ARG_FILENAME, &pidfile, "Specify the location of a PID file", "filename" },
363
{ "state-file", 0, 0, G_OPTION_ARG_FILENAME, &state_file, "State file location", "/path/to/state.file" },
364
{ "config", 0, 0, G_OPTION_ARG_FILENAME, &config_path, "Config file location", "/path/to/config.file" },
365
{ "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, "List of plugins separated by ','", "plugin1,plugin2" },
366
{ "log-level", 0, 0, G_OPTION_ARG_STRING, &log_level, "Log level: one of [ERR, WARN, INFO, DEBUG]", "INFO" },
360
{ "version", 0, 0, G_OPTION_ARG_NONE, &show_version, N_("Print NetworkManager version and exit"), NULL },
361
{ "no-daemon", 0, 0, G_OPTION_ARG_NONE, &become_daemon, N_("Don't become a daemon"), NULL },
362
{ "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &g_fatal_warnings, N_("Make all warnings fatal"), NULL },
363
{ "pid-file", 0, 0, G_OPTION_ARG_FILENAME, &pidfile, N_("Specify the location of a PID file"), N_("filename") },
364
{ "state-file", 0, 0, G_OPTION_ARG_FILENAME, &state_file, N_("State file location"), N_("/path/to/state.file") },
365
{ "config", 0, 0, G_OPTION_ARG_FILENAME, &config_path, N_("Config file location"), N_("/path/to/config.file") },
366
{ "plugins", 0, 0, G_OPTION_ARG_STRING, &plugins, N_("List of plugins separated by ','"), N_("plugin1,plugin2") },
367
/* Translators: Do not translate the values in the square brackets */
368
{ "log-level", 0, 0, G_OPTION_ARG_STRING, &log_level, N_("Log level: one of [ERR, WARN, INFO, DEBUG]"), "INFO" },
367
369
{ "log-domains", 0, 0, G_OPTION_ARG_STRING, &log_domains,
368
"Log domains separated by ',': any combination of\n"
370
/* Translators: Do not translate the values in the square brackets */
371
N_("Log domains separated by ',': any combination of\n"
369
372
" [NONE,HW,RFKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,\n"
370
373
" WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,\n"
371
374
" AGENTS,SETTINGS,SUSPEND,CORE,DEVICE,OLPC,WIMAX,\n"
372
" INFINIBAND,FIREWALL]",
375
" INFINIBAND,FIREWALL]"),
373
376
"HW,RFKILL,WIFI" },
377
380
if (!g_module_supported ()) {
378
fprintf (stderr, "GModules are not supported on your platform!\n");
381
fprintf (stderr, _("GModules are not supported on your platform!\n"));
385
/* Set locale to be able to use environment variables */
386
setlocale (LC_ALL, "");
382
388
bindtextdomain (GETTEXT_PACKAGE, NMLOCALEDIR);
383
389
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
384
390
textdomain (GETTEXT_PACKAGE);
386
392
/* Parse options */
387
opt_ctx = g_option_context_new ("");
388
g_option_context_set_translation_domain (opt_ctx, "UTF-8");
393
opt_ctx = g_option_context_new (NULL);
394
g_option_context_set_translation_domain (opt_ctx, GETTEXT_PACKAGE);
389
395
g_option_context_set_ignore_unknown_options (opt_ctx, FALSE);
390
396
g_option_context_set_help_enabled (opt_ctx, TRUE);
391
397
g_option_context_add_main_entries (opt_ctx, options, NULL);
393
399
g_option_context_set_summary (opt_ctx,
394
"NetworkManager monitors all network connections and automatically\nchooses the best connection to use. It also allows the user to\nspecify wireless access points which wireless cards in the computer\nshould associate with.");
400
_("NetworkManager monitors all network connections and automatically\nchooses the best connection to use. It also allows the user to\nspecify wireless access points which wireless cards in the computer\nshould associate with."));
396
402
success = g_option_context_parse (opt_ctx, &argc, &argv, NULL);
397
403
g_option_context_free (opt_ctx);