VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp@ 24672

Last change on this file since 24672 was 24505, checked in by vboxsync, 15 years ago

VBoxManage: no toggle mode (on/off) required for --forceunmount

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 27.2 KB
Line 
1/* $Id: VBoxManageHelp.cpp 24505 2009-11-09 13:47:06Z vboxsync $ */
2/** @file
3 * VBoxManage - help and other message output.
4 */
5
6/*
7 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#include <iprt/ctype.h>
23#include <iprt/err.h>
24#include <iprt/getopt.h>
25#include <iprt/stream.h>
26
27#include "VBoxManage.h"
28
29void printUsage(USAGECATEGORY u64Cmd)
30{
31#ifdef RT_OS_LINUX
32 bool fLinux = true;
33#else
34 bool fLinux = false;
35#endif
36#ifdef RT_OS_WINDOWS
37 bool fWin = true;
38#else
39 bool fWin = false;
40#endif
41#ifdef RT_OS_SOLARIS
42 bool fSolaris = true;
43#else
44 bool fSolaris = false;
45#endif
46#ifdef RT_OS_DARWIN
47 bool fDarwin = true;
48#else
49 bool fDarwin = false;
50#endif
51#ifdef VBOX_WITH_VRDP
52 bool fVRDP = true;
53#else
54 bool fVRDP = false;
55#endif
56#ifdef VBOX_WITH_VBOXSDL
57 bool fVBoxSDL = true;
58#else
59 bool fVBoxSDL = false;
60#endif
61
62 if (u64Cmd == USAGE_DUMPOPTS)
63 {
64 fLinux = true;
65 fWin = true;
66 fSolaris = true;
67 fDarwin = true;
68 fVRDP = true;
69 fVBoxSDL = true;
70 u64Cmd = USAGE_ALL;
71 }
72
73 RTPrintf("Usage:\n"
74 "\n");
75
76 if (u64Cmd == USAGE_ALL)
77 {
78 RTPrintf("VBoxManage [-v|--version] print version number and exit\n"
79 "VBoxManage [-q|--nologo] ... suppress the logo\n"
80 "\n");
81 }
82
83 if (u64Cmd & USAGE_LIST)
84 {
85 RTPrintf("VBoxManage list [--long|-l] vms|runningvms|ostypes|hostdvds|hostfloppies|\n"
86#if defined(VBOX_WITH_NETFLT)
87 " bridgedifs|hostonlyifs|dhcpservers|hostinfo|\n"
88#else
89 " bridgedifs|dhcpservers|hostinfo|\n"
90#endif
91 " hostcpuids|hddbackends|hdds|dvds|floppies|\n"
92 " usbhost|usbfilters|systemproperties\n"
93 "\n");
94 }
95
96 if (u64Cmd & USAGE_SHOWVMINFO)
97 {
98 RTPrintf("VBoxManage showvminfo <uuid>|<name> [--details] [--statistics]\n"
99 " [--machinereadable]\n"
100 "\n");
101 }
102
103 if (u64Cmd & USAGE_REGISTERVM)
104 {
105 RTPrintf("VBoxManage registervm <filename>\n"
106 "\n");
107 }
108
109 if (u64Cmd & USAGE_UNREGISTERVM)
110 {
111 RTPrintf("VBoxManage unregistervm <uuid>|<name> [--delete]\n"
112 "\n");
113 }
114
115 if (u64Cmd & USAGE_CREATEVM)
116 {
117 RTPrintf("VBoxManage createvm --name <name>\n"
118 " [--ostype <ostype>]\n"
119 " [--register]\n"
120 " [--basefolder <path> | --settingsfile <path>]\n"
121 " [--uuid <uuid>]\n"
122 "\n");
123 }
124
125 if (u64Cmd & USAGE_MODIFYVM)
126 {
127 RTPrintf("VBoxManage modifyvm <uuid|name>\n"
128 " [--name <name>]\n"
129 " [--ostype <ostype>]\n"
130 " [--memory <memorysize in MB>]\n"
131 " [--vram <vramsize in MB>]\n"
132 " [--acpi on|off]\n"
133 " [--ioapic on|off]\n"
134 " [--pae on|off]\n"
135 " [--hwvirtex on|off]\n"
136 " [--nestedpaging on|off]\n"
137 " [--vtxvpid on|off]\n"
138 " [--cpuidset <leaf> <eax> <ebx> <ecx> <edx>]\n"
139 " [--cpuidremove <leaf>]\n"
140 " [--cpuidremoveall]\n"
141 " [--cpus <number>]\n"
142 " [--monitorcount <number>]\n"
143 " [--accelerate3d <on|off>]\n"
144#ifdef VBOX_WITH_VIDEOHWACCEL
145 " [--accelerate2dvideo <on|off>]\n"
146#endif
147 " [--firmware bios|efi]\n"
148 " [--bioslogofadein on|off]\n"
149 " [--bioslogofadeout on|off]\n"
150 " [--bioslogodisplaytime <msec>]\n"
151 " [--bioslogoimagepath <imagepath>]\n"
152 " [--biosbootmenu disabled|menuonly|messageandmenu]\n"
153 " [--biossystemtimeoffset <msec>]\n"
154 " [--biospxedebug on|off]\n"
155 " [--boot<1-4> none|floppy|dvd|disk|net>]\n"
156#if defined(VBOX_WITH_NETFLT)
157 " [--nic<1-N> none|null|nat|bridged|intnet|hostonly]\n"
158#else /* !RT_OS_LINUX && !RT_OS_DARWIN */
159 " [--nic<1-N> none|null|nat|bridged|intnet]\n"
160#endif /* !RT_OS_LINUX && !RT_OS_DARWIN */
161 " [--nictype<1-N> Am79C970A|Am79C973"
162#ifdef VBOX_WITH_E1000
163 "|\n 82540EM|82543GC|82545EM"
164#endif
165#ifdef VBOX_WITH_VIRTIO
166 "|\n virtio"
167#endif /* VBOX_WITH_VIRTIO */
168 "]\n"
169 " [--cableconnected<1-N> on|off]\n"
170 " [--nictrace<1-N> on|off]\n"
171 " [--nictracefile<1-N> <filename>]\n"
172 " [--nicspeed<1-N> <kbps>]\n"
173 " [--bridgeadapter<1-N> none|<devicename>]\n"
174#if defined(VBOX_WITH_NETFLT)
175 " [--hostonlyadapter<1-N> none|<devicename>]\n"
176#endif
177 " [--intnet<1-N> <network name>]\n"
178 " [--natnet<1-N> <network>|default]\n"
179 " [--macaddress<1-N> auto|<mac>]\n"
180 " [--uart<1-N> off|<I/O base> <IRQ>]\n"
181 " [--uartmode<1-N> disconnected|\n"
182 " server <pipe>|\n"
183 " client <pipe>|\n"
184 " file <file>|\n"
185 " <devicename>]\n"
186#ifdef VBOX_WITH_MEM_BALLOONING
187 " [--guestmemoryballoon <balloonsize in MB>]\n"
188#endif
189 " [--gueststatisticsinterval <seconds>]\n"
190 );
191 RTPrintf(" [--audio none|null");
192 if (fWin)
193 {
194#ifdef VBOX_WITH_WINMM
195 RTPrintf( "|winmm|dsound");
196#else
197 RTPrintf( "|dsound");
198#endif
199 }
200 if (fSolaris)
201 {
202 RTPrintf( "|solaudio"
203#ifdef VBOX_WITH_SOLARIS_OSS
204 "|oss"
205#endif
206 );
207 }
208 if (fLinux)
209 {
210 RTPrintf( "|oss"
211#ifdef VBOX_WITH_ALSA
212 "|alsa"
213#endif
214#ifdef VBOX_WITH_PULSE
215 "|pulse"
216#endif
217 );
218 }
219 if (fDarwin)
220 {
221 RTPrintf( "|coreaudio");
222 }
223 RTPrintf( "]\n");
224 RTPrintf(" [--audiocontroller ac97|sb16]\n"
225 " [--clipboard disabled|hosttoguest|guesttohost|\n"
226 " bidirectional]\n");
227 if (fVRDP)
228 {
229 RTPrintf(" [--vrdp on|off]\n"
230 " [--vrdpport default|<ports>]\n"
231 " [--vrdpaddress <host>]\n"
232 " [--vrdpauthtype null|external|guest]\n"
233 " [--vrdpmulticon on|off]\n"
234 " [--vrdpreusecon on|off]\n");
235 }
236 RTPrintf(" [--usb on|off]\n"
237 " [--usbehci on|off]\n"
238 " [--snapshotfolder default|<path>]\n"
239 " [--teleporterenabled on|off]\n"
240 " [--teleporterport <port>]\n"
241 " [--teleporteraddress <address|empty>\n"
242 " [--teleporterpassword <password>]\n"
243 " [--hardwareuuid <uuid>]\n"
244 );
245 RTPrintf("\n");
246 }
247
248 if (u64Cmd & USAGE_IMPORTAPPLIANCE)
249 {
250 RTPrintf("VBoxManage import <ovf> [--dry-run|-n] [more options]\n"
251 " (run with -n to have options displayed\n"
252 " for a particular OVF)\n\n");
253 }
254
255 if (u64Cmd & USAGE_EXPORTAPPLIANCE)
256 {
257 RTPrintf("VBoxManage export <machines> --output|-o <ovf>\n"
258 " [--legacy09]\n"
259 " [--vsys <number of virtual system>]\n"
260 " [--product <product name>]\n"
261 " [--producturl <product url>]\n"
262 " [--vendor <vendor name>]\n"
263 " [--vendorurl <vendor url>]\n"
264 " [--version <version info>]\n"
265 " [--eula <license text>]\n"
266 " [--eulafile <filename>]\n"
267 "\n");
268 }
269
270 if (u64Cmd & USAGE_STARTVM)
271 {
272 RTPrintf("VBoxManage startvm <uuid>|<name>\n");
273 RTPrintf(" [--type gui");
274 if (fVBoxSDL)
275 RTPrintf( "|sdl");
276 if (fVRDP)
277 RTPrintf( "|vrdp");
278 RTPrintf( "|headless]\n");
279 RTPrintf("\n");
280 }
281
282 if (u64Cmd & USAGE_CONTROLVM)
283 {
284 RTPrintf("VBoxManage controlvm <uuid>|<name>\n"
285 " pause|resume|reset|poweroff|savestate|\n"
286 " acpipowerbutton|acpisleepbutton|\n"
287 " keyboardputscancode <hex> [<hex> ...]|\n"
288 " injectnmi|\n"
289 " setlinkstate<1-N> on|off |\n"
290#ifdef VBOX_DYNAMIC_NET_ATTACH
291#if defined(VBOX_WITH_NETFLT)
292 " nic<1-N> null|nat|bridged|intnet|hostonly\n"
293 " [<devicename>] |\n"
294#else /* !RT_OS_LINUX && !RT_OS_DARWIN */
295 " nic<1-N> null|nat|bridged|intnet\n"
296 " [<devicename>] |\n"
297#endif /* !RT_OS_LINUX && !RT_OS_DARWIN */
298 " nictrace<1-N> on|off\n"
299 " nictracefile<1-N> <filename>\n"
300#endif /* VBOX_DYNAMIC_NET_ATTACH */
301 " usbattach <uuid>|<address> |\n"
302 " usbdetach <uuid>|<address> |\n");
303 if (fVRDP)
304 {
305 RTPrintf(" vrdp on|off |\n");
306 RTPrintf(" vrdpport default|<ports> |\n");
307 }
308 RTPrintf(" setvideomodehint <xres> <yres> <bpp> [display] |\n"
309 " setcredentials <username> <password> <domain>\n"
310 " [--allowlocallogon <yes|no>] |\n"
311 " teleport --hostname <name> --port <port>\n"
312 " [--password password]\n"
313 "\n");
314 }
315
316 if (u64Cmd & USAGE_DISCARDSTATE)
317 {
318 RTPrintf("VBoxManage discardstate <uuid>|<name>\n"
319 "\n");
320 }
321
322 if (u64Cmd & USAGE_ADOPTSTATE)
323 {
324 RTPrintf("VBoxManage adoptstate <uuid>|<name> <state_file>\n"
325 "\n");
326 }
327
328 if (u64Cmd & USAGE_SNAPSHOT)
329 {
330 RTPrintf("VBoxManage snapshot <uuid>|<name>\n"
331 " take <name> [--description <desc>] [--pause] |\n"
332 " delete <uuid>|<name> |\n"
333 " restore <uuid>|<name> |\n"
334 " edit <uuid>|<name>|--current\n"
335 " [--name <name>]\n"
336 " [--description <desc>] |\n"
337 " showvminfo <uuid>|<name>\n"
338 "\n");
339 }
340
341 if (u64Cmd & USAGE_OPENMEDIUM)
342 {
343 RTPrintf("VBoxManage openmedium disk|dvd|floppy <filename>\n"
344 " [--type normal|immutable|writethrough] (disk only)\n"
345 "\n");
346 }
347
348 if (u64Cmd & USAGE_CLOSEMEDIUM)
349 {
350 RTPrintf("VBoxManage closemedium disk|dvd|floppy <uuid>|<filename>\n"
351 "\n");
352 }
353
354 if (u64Cmd & USAGE_STORAGEATTACH)
355 {
356 RTPrintf("VBoxManage storageattach <uuid|vmname>\n"
357 " --storagectl <name>\n"
358 " --port <number>\n"
359 " --device <number>\n"
360 " [--type <dvddrive|hdd|fdd>\n"
361 " --medium <none|emptydrive|uuid|filename|host:<drive>>]\n"
362 " [--passthrough <on|off>]\n"
363 " [--forceunmount]\n"
364 "\n");
365 }
366
367 if (u64Cmd & USAGE_STORAGECONTROLLER)
368 {
369 RTPrintf("VBoxManage storagectl <uuid|vmname>\n"
370 " --name <name>\n"
371 " [--add <ide/sata/scsi/floppy>]\n"
372 " [--controller <LsiLogic/BusLogic/IntelAhci/PIIX3/PIIX4/ICH6/I82078>]\n"
373 " [--sataideemulation<1-4> <1-30>]\n"
374 " [--sataportcount <1-30>]\n"
375 " [--remove]\n"
376 "\n");
377 }
378
379 if (u64Cmd & USAGE_SHOWHDINFO)
380 {
381 RTPrintf("VBoxManage showhdinfo <uuid>|<filename>\n"
382 "\n");
383 }
384
385 if (u64Cmd & USAGE_CREATEHD)
386 {
387 RTPrintf("VBoxManage createhd --filename <filename>\n"
388 " --size <megabytes>\n"
389 " [--format VDI|VMDK|VHD] (default: VDI)\n"
390 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
391 " [--type normal|writethrough] (default: normal)\n"
392 " [--comment <comment>]\n"
393 " [--remember]\n"
394 "\n");
395 }
396
397 if (u64Cmd & USAGE_MODIFYHD)
398 {
399 RTPrintf("VBoxManage modifyhd <uuid>|<filename>\n"
400 " [--type normal|writethrough|immutable]\n"
401 " [--autoreset on|off]\n"
402 " [--compact]\n"
403 "\n");
404 }
405
406 if (u64Cmd & USAGE_CLONEHD)
407 {
408 RTPrintf("VBoxManage clonehd <uuid>|<filename> <outputfile>\n"
409 " [--format VDI|VMDK|VHD|RAW|<other>]\n"
410 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
411 " [--type normal|writethrough|immutable]\n"
412 " [--remember] [--existing]\n"
413 "\n");
414 }
415
416 if (u64Cmd & USAGE_CONVERTFROMRAW)
417 {
418 RTPrintf("VBoxManage convertfromraw <filename> <outputfile>\n"
419 " [--format VDI|VMDK|VHD]\n"
420 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
421 "VBoxManage convertfromraw stdin <outputfile> <bytes>\n"
422 " [--format VDI|VMDK|VHD]\n"
423 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
424 "\n");
425 }
426
427 if (u64Cmd & USAGE_ADDISCSIDISK)
428 {
429 RTPrintf("VBoxManage addiscsidisk --server <name>|<ip>\n"
430 " --target <target>\n"
431 " [--port <port>]\n"
432 " [--lun <lun>]\n"
433 " [--encodedlun <lun>]\n"
434 " [--username <username>]\n"
435 " [--password <password>]\n"
436 " [--type normal|writethrough|immutable]\n"
437 " [--comment <comment>]\n"
438 " [--intnet]\n"
439 "\n");
440 }
441
442 if (u64Cmd & USAGE_GETEXTRADATA)
443 {
444 RTPrintf("VBoxManage getextradata global|<uuid>|<name>\n"
445 " <key>|enumerate\n"
446 "\n");
447 }
448
449 if (u64Cmd & USAGE_SETEXTRADATA)
450 {
451 RTPrintf("VBoxManage setextradata global|<uuid>|<name>\n"
452 " <key>\n"
453 " [<value>] (no value deletes key)\n"
454 "\n");
455 }
456
457 if (u64Cmd & USAGE_SETPROPERTY)
458 {
459 RTPrintf("VBoxManage setproperty hdfolder default|<folder> |\n"
460 " machinefolder default|<folder> |\n"
461 " vrdpauthlibrary default|<library> |\n"
462 " websrvauthlibrary default|null|<library> |\n"
463 " loghistorycount <value>\n"
464 "\n");
465 }
466
467 if (u64Cmd & USAGE_USBFILTER_ADD)
468 {
469 RTPrintf("VBoxManage usbfilter add <index,0-N>\n"
470 " --target <uuid>|<name>|global\n"
471 " --name <string>\n"
472 " --action ignore|hold (global filters only)\n"
473 " [--active yes|no] (yes)\n"
474 " [--vendorid <XXXX>] (null)\n"
475 " [--productid <XXXX>] (null)\n"
476 " [--revision <IIFF>] (null)\n"
477 " [--manufacturer <string>] (null)\n"
478 " [--product <string>] (null)\n"
479 " [--remote yes|no] (null, VM filters only)\n"
480 " [--serialnumber <string>] (null)\n"
481 " [--maskedinterfaces <XXXXXXXX>]\n"
482 "\n");
483 }
484
485 if (u64Cmd & USAGE_USBFILTER_MODIFY)
486 {
487 RTPrintf("VBoxManage usbfilter modify <index,0-N>\n"
488 " --target <uuid>|<name>|global\n"
489 " [--name <string>]\n"
490 " [--action ignore|hold] (global filters only)\n"
491 " [--active yes|no]\n"
492 " [--vendorid <XXXX>|\"\"]\n"
493 " [--productid <XXXX>|\"\"]\n"
494 " [--revision <IIFF>|\"\"]\n"
495 " [--manufacturer <string>|\"\"]\n"
496 " [--product <string>|\"\"]\n"
497 " [--remote yes|no] (null, VM filters only)\n"
498 " [--serialnumber <string>|\"\"]\n"
499 " [--maskedinterfaces <XXXXXXXX>]\n"
500 "\n");
501 }
502
503 if (u64Cmd & USAGE_USBFILTER_REMOVE)
504 {
505 RTPrintf("VBoxManage usbfilter remove <index,0-N>\n"
506 " --target <uuid>|<name>|global\n"
507 "\n");
508 }
509
510 if (u64Cmd & USAGE_SHAREDFOLDER_ADD)
511 {
512 RTPrintf("VBoxManage sharedfolder add <vmname>|<uuid>\n"
513 " --name <name> --hostpath <hostpath>\n"
514 " [--transient] [--readonly]\n"
515 "\n");
516 }
517
518 if (u64Cmd & USAGE_SHAREDFOLDER_REMOVE)
519 {
520 RTPrintf("VBoxManage sharedfolder remove <vmname>|<uuid>\n"
521 " --name <name> [--transient]\n"
522 "\n");
523 }
524
525 if (u64Cmd & USAGE_VM_STATISTICS)
526 {
527 RTPrintf("VBoxManage vmstatistics <vmname>|<uuid> [--reset]\n"
528 " [--pattern <pattern>] [--descriptions]\n"
529 "\n");
530 }
531
532#ifdef VBOX_WITH_GUEST_PROPS
533 if (u64Cmd & USAGE_GUESTPROPERTY)
534 usageGuestProperty();
535#endif /* VBOX_WITH_GUEST_PROPS defined */
536
537 if (u64Cmd & USAGE_METRICS)
538 {
539 RTPrintf("VBoxManage metrics list [*|host|<vmname> [<metric_list>]]\n"
540 " (comma-separated)\n\n"
541 "VBoxManage metrics setup\n"
542 " [--period <seconds>]\n"
543 " [--samples <count>]\n"
544 " [--list]\n"
545 " [*|host|<vmname> [<metric_list>]]\n\n"
546 "VBoxManage metrics query [*|host|<vmname> [<metric_list>]]\n\n"
547 "VBoxManage metrics collect\n"
548 " [--period <seconds>]\n"
549 " [--samples <count>]\n"
550 " [--list]\n"
551 " [--detach]\n"
552 " [*|host|<vmname> [<metric_list>]]\n"
553 "\n");
554 }
555#if defined(VBOX_WITH_NETFLT)
556 if (u64Cmd & USAGE_HOSTONLYIFS)
557 {
558 RTPrintf("VBoxManage hostonlyif ipconfig <name>\n"
559 " [--dhcp |\n"
560 " --ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |\n"
561 " --ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]\n"
562# if defined(RT_OS_WINDOWS)
563 " create |\n"
564 " remove <name>\n"
565# endif
566 "\n");
567 }
568#endif
569
570 if (u64Cmd & USAGE_DHCPSERVER)
571 {
572 RTPrintf("VBoxManage dhcpserver add|modify --netname <network_name> |\n"
573#if defined(VBOX_WITH_NETFLT)
574 " --ifname <hostonly_if_name>\n"
575#endif
576 " [--ip <ip_address>\n"
577 " --netmask <network_mask>\n"
578 " --lowerip <lower_ip>\n"
579 " --upperip <upper_ip>]\n"
580 " [--enable | --disable]\n"
581 "VBoxManage dhcpserver remove --netname <network_name> |\n"
582#if defined(VBOX_WITH_NETFLT)
583 " --ifname <hostonly_if_name>\n"
584#endif
585 "\n");
586 }
587}
588
589/**
590 * Print a usage synopsis and the syntax error message.
591 */
592int errorSyntax(USAGECATEGORY u64Cmd, const char *pszFormat, ...)
593{
594 va_list args;
595 showLogo(); // show logo even if suppressed
596#ifndef VBOX_ONLY_DOCS
597 if (g_fInternalMode)
598 printUsageInternal(u64Cmd);
599 else
600 printUsage(u64Cmd);
601#endif /* !VBOX_ONLY_DOCS */
602 va_start(args, pszFormat);
603 RTPrintf("\n"
604 "Syntax error: %N\n", pszFormat, &args);
605 va_end(args);
606 return 1;
607}
608
609/**
610 * errorSyntax for RTGetOpt users.
611 *
612 * @returns 1.
613 *
614 * @param fUsageCategory The usage category of the command.
615 * @param rc The RTGetOpt return code.
616 * @param pValueUnion The value union.
617 */
618int errorGetOpt(USAGECATEGORY fUsageCategory, int rc, union RTGETOPTUNION const *pValueUnion)
619{
620 showLogo(); // show logo even if suppressed
621#ifndef VBOX_ONLY_DOCS
622 if (g_fInternalMode)
623 printUsageInternal(fUsageCategory);
624 else
625 printUsage(fUsageCategory);
626#endif /* !VBOX_ONLY_DOCS */
627
628 if (rc == VINF_GETOPT_NOT_OPTION)
629 return RTPrintf("error: Invalid parameter '%s'\n", pValueUnion->psz);
630 if (rc > 0)
631 {
632 if (RT_C_IS_PRINT(rc))
633 return RTPrintf("error: Invalid option -%c\n", rc);
634 return RTPrintf("error: Invalid option case %i\n", rc);
635 }
636 if (rc == VERR_GETOPT_UNKNOWN_OPTION)
637 return RTPrintf("error: unknown option: %s\n", pValueUnion->psz);
638 if (pValueUnion->pDef)
639 return RTPrintf("error: %s: %Rrs\n", pValueUnion->pDef->pszLong, rc);
640 return RTPrintf("error: %Rrs\n", rc);
641}
642
643/**
644 * Print an error message without the syntax stuff.
645 */
646int errorArgument(const char *pszFormat, ...)
647{
648 va_list args;
649 va_start(args, pszFormat);
650 RTPrintf("error: %N\n", pszFormat, &args);
651 va_end(args);
652 return 1;
653}
654
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette