VirtualBox

Changeset 91187 in vbox


Ignore:
Timestamp:
Sep 9, 2021 10:56:32 PM (3 years ago)
Author:
vboxsync
Message:

VBoxManage: showProgress - another stab at getting the status of a
failed async operation to be printed when necessary.

File:
1 edited

Legend:

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

    r91170 r91187  
    237237    }
    238238
    239     if (fFlags & SHOW_PROGRESS_DESC)
    240     {
    241         com::Bstr bstrDescription;
    242         hrc = progress->COMGETTER(Description(bstrDescription.asOutParam()));
    243         if (FAILED(hrc))
    244         {
    245             RTStrmPrintf(g_pStdErr, "Failed to get progress description: %Rhrc\n", hrc);
    246             return hrc;
    247         }
    248 
    249         const char *pcszDescSep;
    250         if (fFlags & SHOW_PROGRESS_DETAILS)
    251             pcszDescSep = "\n";
    252         else
    253             pcszDescSep = ": ";
    254 
    255         RTStrmPrintf(g_pStdErr, "%ls%s", bstrDescription.raw(), pcszDescSep);
    256         RTStrmFlush(g_pStdErr);
    257     }
    258 
    259239    /*
    260240     * Note: Outputting the progress info to stderr (g_pStdErr) is intentional
     
    262242     *       written in the meanwhile.
    263243     */
     244
     245    if (fFlags & SHOW_PROGRESS_DESC)
     246    {
     247        com::Bstr bstrDescription;
     248        hrc = progress->COMGETTER(Description(bstrDescription.asOutParam()));
     249        if (FAILED(hrc))
     250        {
     251            RTStrmPrintf(g_pStdErr, "Failed to get progress description: %Rhrc\n", hrc);
     252            return hrc;
     253        }
     254
     255        const char *pcszDescSep;
     256        if (fDetailed)          /* multiline output */
     257            pcszDescSep = "\n";
     258        else                    /* continues on the same line */
     259            pcszDescSep = ": ";
     260
     261        RTStrmPrintf(g_pStdErr, "%ls%s", bstrDescription.raw(), pcszDescSep);
     262        RTStrmFlush(g_pStdErr);
     263    }
    264264
    265265    if (!fQuiet && !fDetailed)
     
    389389        else
    390390        {
    391             if (!fQuiet)
    392             {
    393                 if (!fDetailed)
    394                     RTStrmPrintf(g_pStdErr, "\n");
     391            if (fDetailed)
    395392                RTStrmPrintf(g_pStdErr, "Progress state: %Rhrc\n", iRc);
    396             }
     393            else if (fFlags != SHOW_PROGRESS_NONE)
     394                RTStrmPrintf(g_pStdErr, "%Rhrc\n", iRc);
    397395        }
    398396        hrc = iRc;
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