VirtualBox

Changeset 47311 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 22, 2013 3:10:45 PM (12 years ago)
Author:
vboxsync
Message:

VBoxManage/GuestCtrl: Make "guestcontrol list <sessions|processes|all>" available to all.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp

    r47003 r47311  
    258258                 "                            [--directory] [--secure] [--tmpdir <directory>]\n"
    259259                 "                            [--domain <domain>] [--mode <mode>] [--verbose]\n"
     260                 "\n"
     261                 "                            list <all|sessions|processes> [--verbose]\n"
    260262                 "\n"
    261263                 "                            stat\n"
     
    27822784}
    27832785
    2784 #ifdef DEBUG
    27852786static RTEXITCODE handleCtrlList(ComPtr<IGuest> guest, HandlerArg *pArg)
    27862787{
     
    27922793    RTEXITCODE rcExit = RTEXITCODE_SUCCESS;
    27932794
     2795    bool fListAll = false;
    27942796    bool fListSessions = false;
     2797    bool fListProcesses = false;
    27952798    if (!RTStrICmp(pArg->argv[0], "sessions"))
    27962799        fListSessions = true;
    2797     bool fListProcesses = false;
    2798     if (!RTStrICmp(pArg->argv[0], "all"))
    2799     {
    2800         fListSessions = true;
    2801         fListProcesses = true;
    2802     }
    2803 
    2804     if (fListSessions)
     2800    else if (!RTStrICmp(pArg->argv[0], "processes"))
     2801        fListSessions = fListProcesses = true; /* Showing processes implies showing sessions. */
     2802    else if (!RTStrICmp(pArg->argv[0], "all"))
     2803        fListAll = true;
     2804
     2805    /** @todo Handle "--verbose" using RTGetOpt. */
     2806    /** @todo Do we need a machine-readable output here as well? */
     2807
     2808    if (   fListAll
     2809        || fListSessions)
    28052810    {
    28062811        RTPrintf("Active guest sessions:\n");
     
    28282833                             i, uID, strUser.raw(), strName.raw());
    28292834
    2830                     if (fListProcesses)
     2835                    if (   fListAll
     2836                        || fListProcesses)
    28312837                    {
    28322838                        SafeIfaceArray <IGuestProcess> collProcesses;
     
    28652871    return rcExit;
    28662872}
    2867 #endif
    28682873
    28692874/**
     
    29152920                 || !strcmp(pArg->argv[1], "updateadds"))
    29162921            rcExit = handleCtrlUpdateAdditions(guest, &arg);
    2917 #ifdef DEBUG
    29182922        else if (   !strcmp(pArg->argv[1], "list"))
    29192923            rcExit = handleCtrlList(guest, &arg);
    2920 #endif
    2921         /** @todo Implement a "sessions list" command to list all opened
    2922          *        guest sessions along with their (friendly) names. */
    29232924        else
    29242925            rcExit = errorSyntax(USAGE_GUESTCONTROL, "Unknown sub command '%s' specified!", pArg->argv[1]);
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