Changeset 2754 for box/trunk/bin


Ignore:
Timestamp:
22/09/2010 22:12:02 (20 months ago)
Author:
chris
Message:

Allow restoring directories with a single argument, using the remote name
as the local destination name also.

Location:
box/trunk/bin/bbackupquery
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbackupquery/BackupQueries.cpp

    r2699 r2754  
    19521952{ 
    19531953        // Check arguments 
    1954         if(args.size() != 2) 
    1955         { 
    1956                 BOX_ERROR("Incorrect usage. restore [-drif] <remote-name> <local-name>"); 
     1954        if(args.size() < 1 || args.size() > 2) 
     1955        { 
     1956                BOX_ERROR("Incorrect usage. restore [-drif] <remote-name> " 
     1957                        "[<local-name>]"); 
    19571958                return; 
    19581959        } 
     
    19951996                return; 
    19961997        } 
     1998 
    19971999        if(dirID == BackupProtocolClientListDirectory::RootDirectory) 
    19982000        { 
     
    20002002                return; 
    20012003        } 
    2002          
    2003 #ifdef WIN32 
     2004 
    20042005        std::string localName; 
    2005         if(!ConvertConsoleToUtf8(args[1].c_str(), localName)) return; 
    2006 #else 
    2007         std::string localName(args[1]); 
    2008 #endif 
     2006 
     2007        if(args.size() == 2) 
     2008        { 
     2009                #ifdef WIN32 
     2010                        if(!ConvertConsoleToUtf8(args[1].c_str(), localName)) 
     2011                        { 
     2012                                return; 
     2013                        } 
     2014                #else 
     2015                        localName = args[1]; 
     2016                #endif 
     2017        } 
     2018        else 
     2019        { 
     2020                localName = args[0]; 
     2021        } 
    20092022 
    20102023        // Go and restore... 
  • box/trunk/bin/bbackupquery/documentation.txt

    r2637 r2754  
    120120< 
    121121 
    122 > restore [-drif] <directory-name> <local-directory-name> 
     122> restore [-drif] <directory-name> [<local-directory-name>] 
    123123 
    124124        Restores a directory to the local disc. The local directory specified 
    125         must not exist (unless a previous restore is being restarted). 
     125        must not exist (unless a previous restore is being restarted). If the 
     126        local directory is omitted, the default is to restore to the same 
     127        directory name and path, relative to the current local directory, 
     128        as set with the "lcd" command. 
    126129 
    127130        The root cannot be restored -- restore locations individually. 
Note: See TracChangeset for help on using the changeset viewer.