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