~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to services/vmtoolsd/cmdLine.c

  • Committer: Evan Broder
  • Date: 2010-03-21 23:26:53 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: broder@mit.edu-20100321232653-5a57r7v7ch4o6byv
Merging shared upstream rev into target branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
 
153
153
 
154
154
/**
 
155
 * Error hook called when command line parsing fails. On Win32, make sure we
 
156
 * have a terminal where to show the error message.
 
157
 *
 
158
 * @param[in] context    Unused.
 
159
 * @param[in] group      Unused.
 
160
 * @param[in] data       Unused.
 
161
 * @param[in] error      Unused.
 
162
 */
 
163
 
 
164
static void
 
165
ToolsCoreCmdLineError(GOptionContext *context,
 
166
                      GOptionGroup *group,
 
167
                      gpointer data,
 
168
                      GError **error)
 
169
{
 
170
#if defined(_WIN32)
 
171
   VMTools_AttachConsole();
 
172
#endif
 
173
}
 
174
 
 
175
 
 
176
/**
155
177
 * Parses the command line. For a list of available options, look at the source
156
178
 * below, where the option array is declared.
157
179
 *
193
215
         N_("Uninstalls the service from the Service Control Manager."), NULL },
194
216
      { "displayname", 'd', 0, G_OPTION_ARG_STRING, &state->displayName,
195
217
         N_("Service display name (only used with -i)."), N_("name") },
196
 
      { "console", '\0', 0, G_OPTION_ARG_NONE, &state->useConsole,
197
 
         N_("Use the parent process's console window."), NULL },
198
218
#else
199
219
      { "background", 'b', 0, G_OPTION_ARG_FILENAME, &state->pidFile,
200
220
         N_("Runs in the background and creates a pid file."), N_("pidfile") },
223
243
   g_option_context_set_summary(context, N_("Runs the VMware Tools daemon."));
224
244
#endif
225
245
   g_option_context_add_main_entries(context, clOptions, NULL);
 
246
   g_option_group_set_error_hook(g_option_context_get_main_group(context),
 
247
                                 ToolsCoreCmdLineError);
226
248
 
227
249
   if (!g_option_context_parse(context, &argc, &argv, &error)) {
228
250
      g_printerr("%s: %s\n", N_("Command line parsing failed"), error->message);