VirtualBox

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

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

VRDP port range API: user manual, frontends.

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