VirtualBox

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

Last change on this file since 24340 was 24321, checked in by vboxsync, 15 years ago

--cpuidset/remove/removall

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 27.1 KB
Line 
1/* $Id: VBoxManageHelp.cpp 24321 2009-11-04 12:18:09Z 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|hostinfo|dhcpservers|\n"
90#endif
91 " 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 "\n");
364 }
365
366 if (u64Cmd & USAGE_STORAGECONTROLLER)
367 {
368 RTPrintf("VBoxManage storagectl <uuid|vmname>\n"
369 " --name <name>\n"
370 " [--add <ide/sata/scsi/floppy>]\n"
371 " [--controller <LsiLogic/BusLogic/IntelAhci/PIIX3/PIIX4/ICH6/I82078>]\n"
372 " [--sataideemulation<1-4> <1-30>]\n"
373 " [--sataportcount <1-30>]\n"
374 " [--remove]\n"
375 "\n");
376 }
377
378 if (u64Cmd & USAGE_SHOWHDINFO)
379 {
380 RTPrintf("VBoxManage showhdinfo <uuid>|<filename>\n"
381 "\n");
382 }
383
384 if (u64Cmd & USAGE_CREATEHD)
385 {
386 RTPrintf("VBoxManage createhd --filename <filename>\n"
387 " --size <megabytes>\n"
388 " [--format VDI|VMDK|VHD] (default: VDI)\n"
389 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
390 " [--type normal|writethrough] (default: normal)\n"
391 " [--comment <comment>]\n"
392 " [--remember]\n"
393 "\n");
394 }
395
396 if (u64Cmd & USAGE_MODIFYHD)
397 {
398 RTPrintf("VBoxManage modifyhd <uuid>|<filename>\n"
399 " [--type normal|writethrough|immutable]\n"
400 " [--autoreset on|off]\n"
401 " [--compact]\n"
402 "\n");
403 }
404
405 if (u64Cmd & USAGE_CLONEHD)
406 {
407 RTPrintf("VBoxManage clonehd <uuid>|<filename> <outputfile>\n"
408 " [--format VDI|VMDK|VHD|RAW|<other>]\n"
409 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
410 " [--type normal|writethrough|immutable]\n"
411 " [--remember] [--existing]\n"
412 "\n");
413 }
414
415 if (u64Cmd & USAGE_CONVERTFROMRAW)
416 {
417 RTPrintf("VBoxManage convertfromraw <filename> <outputfile>\n"
418 " [--format VDI|VMDK|VHD]\n"
419 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
420 "VBoxManage convertfromraw stdin <outputfile> <bytes>\n"
421 " [--format VDI|VMDK|VHD]\n"
422 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
423 "\n");
424 }
425
426 if (u64Cmd & USAGE_ADDISCSIDISK)
427 {
428 RTPrintf("VBoxManage addiscsidisk --server <name>|<ip>\n"
429 " --target <target>\n"
430 " [--port <port>]\n"
431 " [--lun <lun>]\n"
432 " [--encodedlun <lun>]\n"
433 " [--username <username>]\n"
434 " [--password <password>]\n"
435 " [--type normal|writethrough|immutable]\n"
436 " [--comment <comment>]\n"
437 " [--intnet]\n"
438 "\n");
439 }
440
441 if (u64Cmd & USAGE_GETEXTRADATA)
442 {
443 RTPrintf("VBoxManage getextradata global|<uuid>|<name>\n"
444 " <key>|enumerate\n"
445 "\n");
446 }
447
448 if (u64Cmd & USAGE_SETEXTRADATA)
449 {
450 RTPrintf("VBoxManage setextradata global|<uuid>|<name>\n"
451 " <key>\n"
452 " [<value>] (no value deletes key)\n"
453 "\n");
454 }
455
456 if (u64Cmd & USAGE_SETPROPERTY)
457 {
458 RTPrintf("VBoxManage setproperty hdfolder default|<folder> |\n"
459 " machinefolder default|<folder> |\n"
460 " vrdpauthlibrary default|<library> |\n"
461 " websrvauthlibrary default|null|<library> |\n"
462 " loghistorycount <value>\n"
463 "\n");
464 }
465
466 if (u64Cmd & USAGE_USBFILTER_ADD)
467 {
468 RTPrintf("VBoxManage usbfilter add <index,0-N>\n"
469 " --target <uuid>|<name>|global\n"
470 " --name <string>\n"
471 " --action ignore|hold (global filters only)\n"
472 " [--active yes|no] (yes)\n"
473 " [--vendorid <XXXX>] (null)\n"
474 " [--productid <XXXX>] (null)\n"
475 " [--revision <IIFF>] (null)\n"
476 " [--manufacturer <string>] (null)\n"
477 " [--product <string>] (null)\n"
478 " [--remote yes|no] (null, VM filters only)\n"
479 " [--serialnumber <string>] (null)\n"
480 " [--maskedinterfaces <XXXXXXXX>]\n"
481 "\n");
482 }
483
484 if (u64Cmd & USAGE_USBFILTER_MODIFY)
485 {
486 RTPrintf("VBoxManage usbfilter modify <index,0-N>\n"
487 " --target <uuid>|<name>|global\n"
488 " [--name <string>]\n"
489 " [--action ignore|hold] (global filters only)\n"
490 " [--active yes|no]\n"
491 " [--vendorid <XXXX>|\"\"]\n"
492 " [--productid <XXXX>|\"\"]\n"
493 " [--revision <IIFF>|\"\"]\n"
494 " [--manufacturer <string>|\"\"]\n"
495 " [--product <string>|\"\"]\n"
496 " [--remote yes|no] (null, VM filters only)\n"
497 " [--serialnumber <string>|\"\"]\n"
498 " [--maskedinterfaces <XXXXXXXX>]\n"
499 "\n");
500 }
501
502 if (u64Cmd & USAGE_USBFILTER_REMOVE)
503 {
504 RTPrintf("VBoxManage usbfilter remove <index,0-N>\n"
505 " --target <uuid>|<name>|global\n"
506 "\n");
507 }
508
509 if (u64Cmd & USAGE_SHAREDFOLDER_ADD)
510 {
511 RTPrintf("VBoxManage sharedfolder add <vmname>|<uuid>\n"
512 " --name <name> --hostpath <hostpath>\n"
513 " [--transient] [--readonly]\n"
514 "\n");
515 }
516
517 if (u64Cmd & USAGE_SHAREDFOLDER_REMOVE)
518 {
519 RTPrintf("VBoxManage sharedfolder remove <vmname>|<uuid>\n"
520 " --name <name> [--transient]\n"
521 "\n");
522 }
523
524 if (u64Cmd & USAGE_VM_STATISTICS)
525 {
526 RTPrintf("VBoxManage vmstatistics <vmname>|<uuid> [--reset]\n"
527 " [--pattern <pattern>] [--descriptions]\n"
528 "\n");
529 }
530
531#ifdef VBOX_WITH_GUEST_PROPS
532 if (u64Cmd & USAGE_GUESTPROPERTY)
533 usageGuestProperty();
534#endif /* VBOX_WITH_GUEST_PROPS defined */
535
536 if (u64Cmd & USAGE_METRICS)
537 {
538 RTPrintf("VBoxManage metrics list [*|host|<vmname> [<metric_list>]]\n"
539 " (comma-separated)\n\n"
540 "VBoxManage metrics setup\n"
541 " [--period <seconds>]\n"
542 " [--samples <count>]\n"
543 " [--list]\n"
544 " [*|host|<vmname> [<metric_list>]]\n\n"
545 "VBoxManage metrics query [*|host|<vmname> [<metric_list>]]\n\n"
546 "VBoxManage metrics collect\n"
547 " [--period <seconds>]\n"
548 " [--samples <count>]\n"
549 " [--list]\n"
550 " [--detach]\n"
551 " [*|host|<vmname> [<metric_list>]]\n"
552 "\n");
553 }
554#if defined(VBOX_WITH_NETFLT)
555 if (u64Cmd & USAGE_HOSTONLYIFS)
556 {
557 RTPrintf("VBoxManage hostonlyif ipconfig <name>\n"
558 " [--dhcp |\n"
559 " --ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |\n"
560 " --ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]\n"
561# if defined(RT_OS_WINDOWS)
562 " create |\n"
563 " remove <name>\n"
564# endif
565 "\n");
566 }
567#endif
568
569 if (u64Cmd & USAGE_DHCPSERVER)
570 {
571 RTPrintf("VBoxManage dhcpserver add|modify --netname <network_name> |\n"
572#if defined(VBOX_WITH_NETFLT)
573 " --ifname <hostonly_if_name>\n"
574#endif
575 " [--ip <ip_address>\n"
576 " --netmask <network_mask>\n"
577 " --lowerip <lower_ip>\n"
578 " --upperip <upper_ip>]\n"
579 " [--enable | --disable]\n"
580 "VBoxManage dhcpserver remove --netname <network_name> |\n"
581#if defined(VBOX_WITH_NETFLT)
582 " --ifname <hostonly_if_name>\n"
583#endif
584 "\n");
585 }
586}
587
588/**
589 * Print a usage synopsis and the syntax error message.
590 */
591int errorSyntax(USAGECATEGORY u64Cmd, const char *pszFormat, ...)
592{
593 va_list args;
594 showLogo(); // show logo even if suppressed
595#ifndef VBOX_ONLY_DOCS
596 if (g_fInternalMode)
597 printUsageInternal(u64Cmd);
598 else
599 printUsage(u64Cmd);
600#endif /* !VBOX_ONLY_DOCS */
601 va_start(args, pszFormat);
602 RTPrintf("\n"
603 "Syntax error: %N\n", pszFormat, &args);
604 va_end(args);
605 return 1;
606}
607
608/**
609 * errorSyntax for RTGetOpt users.
610 *
611 * @returns 1.
612 *
613 * @param fUsageCategory The usage category of the command.
614 * @param rc The RTGetOpt return code.
615 * @param pValueUnion The value union.
616 */
617int errorGetOpt(USAGECATEGORY fUsageCategory, int rc, union RTGETOPTUNION const *pValueUnion)
618{
619 showLogo(); // show logo even if suppressed
620#ifndef VBOX_ONLY_DOCS
621 if (g_fInternalMode)
622 printUsageInternal(fUsageCategory);
623 else
624 printUsage(fUsageCategory);
625#endif /* !VBOX_ONLY_DOCS */
626
627 if (rc == VINF_GETOPT_NOT_OPTION)
628 return RTPrintf("error: Invalid parameter '%s'\n", pValueUnion->psz);
629 if (rc > 0)
630 {
631 if (RT_C_IS_PRINT(rc))
632 return RTPrintf("error: Invalid option -%c\n", rc);
633 return RTPrintf("error: Invalid option case %i\n", rc);
634 }
635 if (rc == VERR_GETOPT_UNKNOWN_OPTION)
636 return RTPrintf("error: unknown option: %s\n", pValueUnion->psz);
637 if (pValueUnion->pDef)
638 return RTPrintf("error: %s: %Rrs\n", pValueUnion->pDef->pszLong, rc);
639 return RTPrintf("error: %Rrs\n", rc);
640}
641
642/**
643 * Print an error message without the syntax stuff.
644 */
645int errorArgument(const char *pszFormat, ...)
646{
647 va_list args;
648 va_start(args, pszFormat);
649 RTPrintf("error: %N\n", pszFormat, &args);
650 va_end(args);
651 return 1;
652}
653
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