VirtualBox

Changeset 25873 in vbox


Ignore:
Timestamp:
Jan 18, 2010 8:53:22 AM (15 years ago)
Author:
vboxsync
Message:

Additions/VBoxControl+VBoxClient: fix usage formatting

Location:
trunk/src/VBox/Additions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp

    r25347 r25873  
    55
    66/*
    7  * Copyright (C) 2007 Sun Microsystems, Inc.
     7 * Copyright (C) 2008-2010 Sun Microsystems, Inc.
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6161static void doUsage(char const *line, char const *name = "", char const *command = "")
    6262{
    63     RTPrintf("%s %-*s%s", name, 32 - strlen(name), command, line);
     63    /* Allow for up to 15 characters command name length (VBoxControl.exe) with
     64     * perfect column alignment. Beyond that there's at least one space between
     65     * the command if there are command line parameters. */
     66    RTPrintf("%s %-*s%s%s\n", name, strlen(line) ? 35 - strlen(name) : 1,
     67                              command, strlen(line) ? " " : "", line);
    6468}
    6569
     
    6771enum g_eUsage
    6872{
    69 #ifdef RT_OS_WINDOWS
     73#ifdef RT_OS_LINUX
    7074    GET_VIDEO_ACCEL,
    7175    SET_VIDEO_ACCEL,
     
    8488{
    8589    RTPrintf("Usage:\n\n");
    86     RTPrintf("%s [-v|-version]        print version number and exit\n", g_pszProgName);
    87     RTPrintf("%s -nologo ...          suppress the logo\n\n", g_pszProgName);
     90    doUsage("print version number and exit", g_pszProgName, "[-v|-version]");
     91    doUsage("suppress the logo", g_pszProgName, "-nologo ...");
     92    RTPrintf("\n");
    8893
    8994/* Exclude the Windows bits from the test version.  Anyone who needs to test
    9095 * them can fix this. */
    91 #if defined(RT_OS_WINDOWS) && !defined(VBOX_CONTROL_TEST)
     96#if defined(RT_OS_LINUX) && !defined(VBOX_CONTROL_TEST)
    9297    if ((GET_VIDEO_ACCEL == eWhich) || (USAGE_ALL == eWhich))
    93         doUsage("\n", g_pszProgName, "getvideoacceleration");
     98        doUsage("", g_pszProgName, "getvideoacceleration");
    9499    if ((SET_VIDEO_ACCEL == eWhich) || (USAGE_ALL == eWhich))
    95         doUsage("<on|off>\n", g_pszProgName, "setvideoacceleration");
     100        doUsage("<on|off>", g_pszProgName, "setvideoacceleration");
    96101    if ((LIST_CUST_MODES == eWhich) || (USAGE_ALL == eWhich))
    97         doUsage("\n", g_pszProgName, "listcustommodes");
     102        doUsage("", g_pszProgName, "listcustommodes");
    98103    if ((ADD_CUST_MODE == eWhich) || (USAGE_ALL == eWhich))
    99         doUsage("<width> <height> <bpp>\n", g_pszProgName, "addcustommode");
     104        doUsage("<width> <height> <bpp>", g_pszProgName, "addcustommode");
    100105    if ((REMOVE_CUST_MODE == eWhich) || (USAGE_ALL == eWhich))
    101         doUsage("<width> <height> <bpp>\n", g_pszProgName, "removecustommode");
     106        doUsage("<width> <height> <bpp>", g_pszProgName, "removecustommode");
    102107    if ((SET_VIDEO_MODE == eWhich) || (USAGE_ALL == eWhich))
    103         doUsage("<width> <height> <bpp> <screen>\n", g_pszProgName, "setvideomode");
     108        doUsage("<width> <height> <bpp> <screen>", g_pszProgName, "setvideomode");
    104109#endif
    105110#ifdef VBOX_WITH_GUEST_PROPS
    106111    if ((GUEST_PROP == eWhich) || (USAGE_ALL == eWhich))
    107112    {
    108         doUsage("get <property> [-verbose]\n", g_pszProgName, "guestproperty");
    109         doUsage("set <property> [<value> [-flags <flags>]]\n", g_pszProgName, "guestproperty");
    110         doUsage("enumerate [-patterns <patterns>]\n", g_pszProgName, "guestproperty");
    111         doUsage("wait <patterns> [-timestamp <last timestamp>]\n", g_pszProgName, "guestproperty");
    112         doUsage("[-timeout <timeout in ms>\n");
     113        doUsage("get <property> [-verbose]", g_pszProgName, "guestproperty");
     114        doUsage("set <property> [<value> [-flags <flags>]]", g_pszProgName, "guestproperty");
     115        doUsage("enumerate [-patterns <patterns>]", g_pszProgName, "guestproperty");
     116        doUsage("wait <patterns>", g_pszProgName, "guestproperty");
     117        doUsage("[-timestamp <last timestamp>]");
     118        doUsage("[-timeout <timeout in ms>");
    113119    }
    114120#endif
     
    13421348        RTPrintf("VirtualBox Guest Additions Command Line Management Interface Version "
    13431349                 VBOX_VERSION_STRING "\n"
    1344                  "(C) 2008 Sun Microsystems, Inc.\n"
     1350                 "(C) 2008-2010 Sun Microsystems, Inc.\n"
    13451351                 "All rights reserved.\n\n");
    13461352    if (dohelp)
  • trunk/src/VBox/Additions/x11/VBoxClient/main.cpp

    r24069 r25873  
    66
    77/*
    8  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    136136    RTPrintf("Start the VirtualBox X Window System guest services.\n\n");
    137137    RTPrintf("Options:\n");
    138     RTPrintf("  --clipboard      start the shared clipboard service\n");
    139     RTPrintf("  --display     start the display management service\n");
     138    RTPrintf("  --clipboard        start the shared clipboard service\n");
     139    RTPrintf("  --display          start the display management service\n");
    140140# ifdef VBOX_WITH_GUEST_PROPS
    141     RTPrintf("  --checkhostversion      start the host version notifier service\n");
     141    RTPrintf("  --checkhostversion start the host version notifier service\n");
    142142# endif
    143     RTPrintf("  --seamless       start the seamless windows service\n");
    144     RTPrintf("  -d, --nodaemon   continue running as a system service\n");
     143    RTPrintf("  --seamless         start the seamless windows service\n");
     144    RTPrintf("  -d, --nodaemon     continue running as a system service\n");
    145145    RTPrintf("\n");
    146146    exit(0);
Note: See TracChangeset for help on using the changeset viewer.

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