VirtualBox

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

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

VBoxManage: storagectl => name, floppy => fdd, type => controller

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