VirtualBox

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

Last change on this file since 23801 was 23801, checked in by vboxsync, 16 years ago

Main,VMM,Frontends,++: Teminology. Added a bind address for the (target) teleporter.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 26.9 KB
Line 
1/* $Id: VBoxManageHelp.cpp 23801 2009-10-15 15:00:47Z 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 " [--firmware bios|efi]\n"
133 " [--acpi on|off]\n"
134 " [--ioapic on|off]\n"
135 " [--pae on|off]\n"
136 " [--hwvirtex on|off]\n"
137 " [--nestedpaging on|off]\n"
138 " [--vtxvpid on|off]\n"
139 " [--cpus <number>]\n"
140 " [--monitorcount <number>]\n"
141 " [--accelerate3d <on|off>]\n"
142#ifdef VBOX_WITH_VIDEOHWACCEL
143 " [--accelerate2dvideo <on|off>]\n"
144#endif
145 " [--bioslogofadein on|off]\n"
146 " [--bioslogofadeout on|off]\n"
147 " [--bioslogodisplaytime <msec>]\n"
148 " [--bioslogoimagepath <imagepath>]\n"
149 " [--biosbootmenu disabled|menuonly|messageandmenu]\n"
150 " [--biossystemtimeoffset <msec>]\n"
151 " [--biospxedebug on|off]\n"
152 " [--boot<1-4> none|floppy|dvd|disk|net>]\n"
153 " [--hd<a|b|d> none|<uuid>|<filename>]\n"
154 " [--idecontroller PIIX3|PIIX4]\n"
155#ifdef VBOX_WITH_AHCI
156 " [--sata on|off]\n"
157 " [--sataportcount <1-30>]\n"
158 " [--sataport<1-30> none|<uuid>|<filename>]\n"
159 " [--sataideemulation<1-4> <1-30>]\n"
160#endif
161#ifdef VBOX_WITH_SCSI
162 " [--scsi on|off]\n"
163 " [--scsiport<1-16> none|<uuid>|<filename>]\n"
164 " [--scsitype LsiLogic|BusLogic]\n"
165#endif
166 " [--dvd none|<uuid>|<filename>|host:<drive>]\n"
167 " [--dvdpassthrough on|off]\n"
168 " [--floppy disabled|none|<uuid>|\n"
169 " <filename>|host:<drive>]\n"
170#if defined(VBOX_WITH_NETFLT)
171 " [--nic<1-N> none|null|nat|bridged|intnet|hostonly]\n"
172#else /* !RT_OS_LINUX && !RT_OS_DARWIN */
173 " [--nic<1-N> none|null|nat|bridged|intnet]\n"
174#endif /* !RT_OS_LINUX && !RT_OS_DARWIN */
175 " [--nictype<1-N> Am79C970A|Am79C973"
176#ifdef VBOX_WITH_E1000
177 "|\n 82540EM|82543GC|82545EM"
178#endif
179#ifdef VBOX_WITH_VIRTIO
180 "|\n virtio"
181#endif /* VBOX_WITH_VIRTIO */
182 "]\n"
183 " [--cableconnected<1-N> on|off]\n"
184 " [--nictrace<1-N> on|off]\n"
185 " [--nictracefile<1-N> <filename>]\n"
186 " [--nicspeed<1-N> <kbps>]\n"
187 " [--bridgeadapter<1-N> none|<devicename>]\n"
188#if defined(VBOX_WITH_NETFLT)
189 " [--hostonlyadapter<1-N> none|<devicename>]\n"
190#endif
191 " [--intnet<1-N> <network name>]\n"
192 " [--natnet<1-N> <network>|default]\n"
193 " [--macaddress<1-N> auto|<mac>]\n"
194 " [--uart<1-N> off|<I/O base> <IRQ>]\n"
195 " [--uartmode<1-N> disconnected|\n"
196 " server <pipe>|\n"
197 " client <pipe>|\n"
198 " file <file>|\n"
199 " <devicename>]\n"
200#ifdef VBOX_WITH_MEM_BALLOONING
201 " [--guestmemoryballoon <balloonsize in MB>]\n"
202#endif
203 " [--gueststatisticsinterval <seconds>]\n"
204 );
205 RTPrintf(" [--audio none|null");
206 if (fWin)
207 {
208#ifdef VBOX_WITH_WINMM
209 RTPrintf( "|winmm|dsound");
210#else
211 RTPrintf( "|dsound");
212#endif
213 }
214 if (fSolaris)
215 {
216 RTPrintf( "|solaudio"
217#ifdef VBOX_WITH_SOLARIS_OSS
218 "|oss"
219#endif
220 );
221 }
222 if (fLinux)
223 {
224 RTPrintf( "|oss"
225#ifdef VBOX_WITH_ALSA
226 "|alsa"
227#endif
228#ifdef VBOX_WITH_PULSE
229 "|pulse"
230#endif
231 );
232 }
233 if (fDarwin)
234 {
235 RTPrintf( "|coreaudio");
236 }
237 RTPrintf( "]\n");
238 RTPrintf(" [--audiocontroller ac97|sb16]\n"
239 " [--clipboard disabled|hosttoguest|guesttohost|\n"
240 " bidirectional]\n");
241 if (fVRDP)
242 {
243 RTPrintf(" [--vrdp on|off]\n"
244 " [--vrdpport default|<port>]\n"
245 " [--vrdpaddress <host>]\n"
246 " [--vrdpauthtype null|external|guest]\n"
247 " [--vrdpmulticon on|off]\n"
248 " [--vrdpreusecon on|off]\n");
249 }
250 RTPrintf(" [--usb on|off]\n"
251 " [--usbehci on|off]\n"
252 " [--snapshotfolder default|<path>]\n"
253 " [--teleporterenabled on|off]\n"
254 " [--teleporterport <port>]\n"
255 " [--teleporteraddress <address|empty>\n"
256 " [--teleporterpassword <password>]\n");
257 RTPrintf("\n");
258 }
259
260 if (u64Cmd & USAGE_IMPORTAPPLIANCE)
261 {
262 RTPrintf("VBoxManage import <ovf> [--dry-run|-n] [more options]\n"
263 " (run with -n to have options displayed\n"
264 " for a particular OVF)\n\n");
265 }
266
267 if (u64Cmd & USAGE_EXPORTAPPLIANCE)
268 {
269 RTPrintf("VBoxManage export <machines> --output|-o <ovf>\n"
270 " [--legacy09]\n"
271 " [--vsys <number of virtual system>]\n"
272 " [--product <product name>]\n"
273 " [--producturl <product url>]\n"
274 " [--vendor <vendor name>]\n"
275 " [--vendorurl <vendor url>]\n"
276 " [--version <version info>]\n"
277 " [--eula <license text>]\n"
278 " [--eulafile <filename>]\n"
279 "\n");
280 }
281
282 if (u64Cmd & USAGE_STARTVM)
283 {
284 RTPrintf("VBoxManage startvm <uuid>|<name>\n");
285 RTPrintf(" [--type gui");
286 if (fVBoxSDL)
287 RTPrintf( "|sdl");
288 if (fVRDP)
289 RTPrintf( "|vrdp");
290 RTPrintf( "|headless]\n");
291 RTPrintf("\n");
292 }
293
294 if (u64Cmd & USAGE_CONTROLVM)
295 {
296 RTPrintf("VBoxManage controlvm <uuid>|<name>\n"
297 " pause|resume|reset|poweroff|savestate|\n"
298 " acpipowerbutton|acpisleepbutton|\n"
299 " keyboardputscancode <hex> [<hex> ...]|\n"
300 " injectnmi|\n"
301 " setlinkstate<1-N> on|off |\n"
302#ifdef VBOX_DYNAMIC_NET_ATTACH
303#if defined(VBOX_WITH_NETFLT)
304 " nic<1-N> null|nat|bridged|intnet|hostonly\n"
305 " [<devicename>] |\n"
306#else /* !RT_OS_LINUX && !RT_OS_DARWIN */
307 " nic<1-N> null|nat|bridged|intnet\n"
308 " [<devicename>] |\n"
309#endif /* !RT_OS_LINUX && !RT_OS_DARWIN */
310 " nictrace<1-N> on|off\n"
311 " nictracefile<1-N> <filename>\n"
312#endif /* VBOX_DYNAMIC_NET_ATTACH */
313 " usbattach <uuid>|<address> |\n"
314 " usbdetach <uuid>|<address> |\n"
315 " dvdattach none|<uuid>|<filename>|host:<drive> |\n"
316 " floppyattach none|<uuid>|<filename>|host:<drive> |\n");
317 if (fVRDP)
318 {
319 RTPrintf(" vrdp on|off] |\n");
320 RTPrintf(" vrdpport default|<port>] |\n");
321 }
322 RTPrintf(" setvideomodehint <xres> <yres> <bpp> [display] |\n"
323 " setcredentials <username> <password> <domain>\n"
324 " [--allowlocallogon <yes|no>] |\n"
325 " teleport --hostname <name> --port <port>\n"
326 " [--password password]\n"
327 "\n");
328 }
329
330 if (u64Cmd & USAGE_DISCARDSTATE)
331 {
332 RTPrintf("VBoxManage discardstate <uuid>|<name>\n"
333 "\n");
334 }
335
336 if (u64Cmd & USAGE_ADOPTSTATE)
337 {
338 RTPrintf("VBoxManage adoptstate <uuid>|<name> <state_file>\n"
339 "\n");
340 }
341
342 if (u64Cmd & USAGE_SNAPSHOT)
343 {
344 RTPrintf("VBoxManage snapshot <uuid>|<name>\n"
345 " take <name> [--description <desc>] [--pause] |\n"
346 " discard <uuid>|<name> |\n"
347 " discardcurrent --state|--all |\n"
348 " edit <uuid>|<name>|--current\n"
349 " [--name <name>]\n"
350 " [--description <desc>] |\n"
351 " showvminfo <uuid>|<name>\n"
352 "\n");
353 }
354
355 if (u64Cmd & USAGE_OPENMEDIUM)
356 {
357 RTPrintf("VBoxManage openmedium disk|dvd|floppy <filename>\n"
358 " [--type normal|immutable|writethrough] (disk only)\n"
359 "\n");
360 }
361
362 if (u64Cmd & USAGE_CLOSEMEDIUM)
363 {
364 RTPrintf("VBoxManage closemedium disk|dvd|floppy <uuid>|<filename>\n"
365 "\n");
366 }
367
368 if (u64Cmd & USAGE_SHOWHDINFO)
369 {
370 RTPrintf("VBoxManage showhdinfo <uuid>|<filename>\n"
371 "\n");
372 }
373
374 if (u64Cmd & USAGE_CREATEHD)
375 {
376 RTPrintf("VBoxManage createhd --filename <filename>\n"
377 " --size <megabytes>\n"
378 " [--format VDI|VMDK|VHD] (default: VDI)\n"
379 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
380 " [--type normal|writethrough] (default: normal)\n"
381 " [--comment <comment>]\n"
382 " [--remember]\n"
383 "\n");
384 }
385
386 if (u64Cmd & USAGE_MODIFYHD)
387 {
388 RTPrintf("VBoxManage modifyhd <uuid>|<filename>\n"
389 " [--type normal|writethrough|immutable]\n"
390 " [--autoreset on|off]\n"
391 " [--compact]\n"
392 "\n");
393 }
394
395 if (u64Cmd & USAGE_CLONEHD)
396 {
397 RTPrintf("VBoxManage clonehd <uuid>|<filename> <outputfile>\n"
398 " [--format VDI|VMDK|VHD|RAW|<other>]\n"
399 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
400 " [--type normal|writethrough|immutable]\n"
401 " [--remember] [--existing]\n"
402 "\n");
403 }
404
405 if (u64Cmd & USAGE_CONVERTFROMRAW)
406 {
407 RTPrintf("VBoxManage convertfromraw <filename> <outputfile>\n"
408 " [--format VDI|VMDK|VHD]\n"
409 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
410 "VBoxManage convertfromraw stdin <outputfile> <bytes>\n"
411 " [--format VDI|VMDK|VHD]\n"
412 " [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
413 "\n");
414 }
415
416 if (u64Cmd & USAGE_ADDISCSIDISK)
417 {
418 RTPrintf("VBoxManage addiscsidisk --server <name>|<ip>\n"
419 " --target <target>\n"
420 " [--port <port>]\n"
421 " [--lun <lun>]\n"
422 " [--encodedlun <lun>]\n"
423 " [--username <username>]\n"
424 " [--password <password>]\n"
425 " [--type normal|writethrough|immutable]\n"
426 " [--comment <comment>]\n"
427 " [--intnet]\n"
428 "\n");
429 }
430
431 if (u64Cmd & USAGE_GETEXTRADATA)
432 {
433 RTPrintf("VBoxManage getextradata global|<uuid>|<name>\n"
434 " <key>|enumerate\n"
435 "\n");
436 }
437
438 if (u64Cmd & USAGE_SETEXTRADATA)
439 {
440 RTPrintf("VBoxManage setextradata global|<uuid>|<name>\n"
441 " <key>\n"
442 " [<value>] (no value deletes key)\n"
443 "\n");
444 }
445
446 if (u64Cmd & USAGE_SETPROPERTY)
447 {
448 RTPrintf("VBoxManage setproperty hdfolder default|<folder> |\n"
449 " machinefolder default|<folder> |\n"
450 " vrdpauthlibrary default|<library> |\n"
451 " websrvauthlibrary default|null|<library> |\n"
452 " loghistorycount <value>\n"
453 "\n");
454 }
455
456 if (u64Cmd & USAGE_USBFILTER_ADD)
457 {
458 RTPrintf("VBoxManage usbfilter add <index,0-N>\n"
459 " --target <uuid>|<name>|global\n"
460 " --name <string>\n"
461 " --action ignore|hold (global filters only)\n"
462 " [--active yes|no] (yes)\n"
463 " [--vendorid <XXXX>] (null)\n"
464 " [--productid <XXXX>] (null)\n"
465 " [--revision <IIFF>] (null)\n"
466 " [--manufacturer <string>] (null)\n"
467 " [--product <string>] (null)\n"
468 " [--remote yes|no] (null, VM filters only)\n"
469 " [--serialnumber <string>] (null)\n"
470 " [--maskedinterfaces <XXXXXXXX>]\n"
471 "\n");
472 }
473
474 if (u64Cmd & USAGE_USBFILTER_MODIFY)
475 {
476 RTPrintf("VBoxManage usbfilter modify <index,0-N>\n"
477 " --target <uuid>|<name>|global\n"
478 " [--name <string>]\n"
479 " [--action ignore|hold] (global filters only)\n"
480 " [--active yes|no]\n"
481 " [--vendorid <XXXX>|\"\"]\n"
482 " [--productid <XXXX>|\"\"]\n"
483 " [--revision <IIFF>|\"\"]\n"
484 " [--manufacturer <string>|\"\"]\n"
485 " [--product <string>|\"\"]\n"
486 " [--remote yes|no] (null, VM filters only)\n"
487 " [--serialnumber <string>|\"\"]\n"
488 " [--maskedinterfaces <XXXXXXXX>]\n"
489 "\n");
490 }
491
492 if (u64Cmd & USAGE_USBFILTER_REMOVE)
493 {
494 RTPrintf("VBoxManage usbfilter remove <index,0-N>\n"
495 " --target <uuid>|<name>|global\n"
496 "\n");
497 }
498
499 if (u64Cmd & USAGE_SHAREDFOLDER_ADD)
500 {
501 RTPrintf("VBoxManage sharedfolder add <vmname>|<uuid>\n"
502 " --name <name> --hostpath <hostpath>\n"
503 " [--transient] [--readonly]\n"
504 "\n");
505 }
506
507 if (u64Cmd & USAGE_SHAREDFOLDER_REMOVE)
508 {
509 RTPrintf("VBoxManage sharedfolder remove <vmname>|<uuid>\n"
510 " --name <name> [--transient]\n"
511 "\n");
512 }
513
514 if (u64Cmd & USAGE_VM_STATISTICS)
515 {
516 RTPrintf("VBoxManage vmstatistics <vmname>|<uuid> [--reset]\n"
517 " [--pattern <pattern>] [--descriptions]\n"
518 "\n");
519 }
520
521#ifdef VBOX_WITH_GUEST_PROPS
522 if (u64Cmd & USAGE_GUESTPROPERTY)
523 usageGuestProperty();
524#endif /* VBOX_WITH_GUEST_PROPS defined */
525
526 if (u64Cmd & USAGE_METRICS)
527 {
528 RTPrintf("VBoxManage metrics list [*|host|<vmname> [<metric_list>]]\n"
529 " (comma-separated)\n\n"
530 "VBoxManage metrics setup\n"
531 " [--period <seconds>]\n"
532 " [--samples <count>]\n"
533 " [--list]\n"
534 " [*|host|<vmname> [<metric_list>]]\n\n"
535 "VBoxManage metrics query [*|host|<vmname> [<metric_list>]]\n\n"
536 "VBoxManage metrics collect\n"
537 " [--period <seconds>]\n"
538 " [--samples <count>]\n"
539 " [--list]\n"
540 " [--detach]\n"
541 " [*|host|<vmname> [<metric_list>]]\n"
542 "\n");
543 }
544#if defined(VBOX_WITH_NETFLT)
545 if (u64Cmd & USAGE_HOSTONLYIFS)
546 {
547 RTPrintf("VBoxManage hostonlyif ipconfig <name>\n"
548 " [--dhcp |\n"
549 " --ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |\n"
550 " --ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]\n"
551# if defined(RT_OS_WINDOWS)
552 " create |\n"
553 " remove <name>\n"
554# endif
555 "\n");
556 }
557#endif
558
559 if (u64Cmd & USAGE_DHCPSERVER)
560 {
561 RTPrintf("VBoxManage dhcpserver add|modify --netname <network_name> |\n"
562#if defined(VBOX_WITH_NETFLT)
563 " --ifname <hostonly_if_name>\n"
564#endif
565 " [--ip <ip_address>\n"
566 " --netmask <network_mask>\n"
567 " --lowerip <lower_ip>\n"
568 " --upperip <upper_ip>]\n"
569 " [--enable | --disable]\n"
570 "VBoxManage dhcpserver remove --netname <network_name> |\n"
571#if defined(VBOX_WITH_NETFLT)
572 " --ifname <hostonly_if_name>\n"
573#endif
574 "\n");
575 }
576}
577
578/**
579 * Print a usage synopsis and the syntax error message.
580 */
581int errorSyntax(USAGECATEGORY u64Cmd, const char *pszFormat, ...)
582{
583 va_list args;
584 showLogo(); // show logo even if suppressed
585#ifndef VBOX_ONLY_DOCS
586 if (g_fInternalMode)
587 printUsageInternal(u64Cmd);
588 else
589 printUsage(u64Cmd);
590#endif /* !VBOX_ONLY_DOCS */
591 va_start(args, pszFormat);
592 RTPrintf("\n"
593 "Syntax error: %N\n", pszFormat, &args);
594 va_end(args);
595 return 1;
596}
597
598/**
599 * errorSyntax for RTGetOpt users.
600 *
601 * @returns 1.
602 *
603 * @param fUsageCategory The usage category of the command.
604 * @param rc The RTGetOpt return code.
605 * @param pValueUnion The value union.
606 */
607int errorGetOpt(USAGECATEGORY fUsageCategory, int rc, union RTGETOPTUNION const *pValueUnion)
608{
609 showLogo(); // show logo even if suppressed
610#ifndef VBOX_ONLY_DOCS
611 if (g_fInternalMode)
612 printUsageInternal(fUsageCategory);
613 else
614 printUsage(fUsageCategory);
615#endif /* !VBOX_ONLY_DOCS */
616
617 if (rc == VINF_GETOPT_NOT_OPTION)
618 return RTPrintf("error: Invalid parameter '%s'\n", pValueUnion->psz);
619 if (rc > 0)
620 {
621 if (RT_C_IS_PRINT(rc))
622 return RTPrintf("error: Invalid option -%c\n", rc);
623 return RTPrintf("error: Invalid option case %i\n", rc);
624 }
625 if (rc == VERR_GETOPT_UNKNOWN_OPTION)
626 return RTPrintf("error: unknown option: %s\n", pValueUnion->psz);
627 if (pValueUnion->pDef)
628 return RTPrintf("error: %s: %Rrs\n", pValueUnion->pDef->pszLong, rc);
629 return RTPrintf("error: %Rrs\n", rc);
630}
631
632/**
633 * Print an error message without the syntax stuff.
634 */
635int errorArgument(const char *pszFormat, ...)
636{
637 va_list args;
638 va_start(args, pszFormat);
639 RTPrintf("error: %N\n", pszFormat, &args);
640 va_end(args);
641 return 1;
642}
643
Note: See TracBrowser for help on using the repository browser.

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