Changeset 2353
- Timestamp:
- 17/10/2008 00:15:25 (4 years ago)
- Location:
- box/trunk/bin/bbackupquery
- Files:
-
- 3 edited
-
BackupQueries.cpp (modified) (4 diffs)
-
BackupQueries.h (modified) (1 diff)
-
documentation.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/bin/bbackupquery/BackupQueries.cpp
r2283 r2353 223 223 { "restore", "drif" }, 224 224 { "help", "" }, 225 { "usage", " " },225 { "usage", "m" }, 226 226 { "undelete", "" }, 227 227 { "delete", "" }, … … 359 359 360 360 case Command_Usage: 361 CommandUsage( );361 CommandUsage(opts); 362 362 break; 363 363 … … 2249 2249 // 2250 2250 // -------------------------------------------------------------------------- 2251 void BackupQueries::CommandUsage() 2252 { 2251 void BackupQueries::CommandUsage(const bool *opts) 2252 { 2253 bool MachineReadable = opts['m']; 2254 2253 2255 // Request full details from the server 2254 2256 std::auto_ptr<BackupProtocolClientAccountUsage> usage(mrConnection.QueryGetAccountUsage()); … … 2257 2259 int64_t hardLimit = usage->GetBlocksHardLimit(); 2258 2260 int32_t blockSize = usage->GetBlockSize(); 2259 CommandUsageDisplayEntry("Used", usage->GetBlocksUsed(), hardLimit, blockSize); 2260 CommandUsageDisplayEntry("Old files", usage->GetBlocksInOldFiles(), hardLimit, blockSize); 2261 CommandUsageDisplayEntry("Deleted files", usage->GetBlocksInDeletedFiles(), hardLimit, blockSize); 2262 CommandUsageDisplayEntry("Directories", usage->GetBlocksInDirectories(), hardLimit, blockSize); 2263 CommandUsageDisplayEntry("Soft limit", usage->GetBlocksSoftLimit(), hardLimit, blockSize); 2264 CommandUsageDisplayEntry("Hard limit", hardLimit, hardLimit, blockSize); 2265 } 2266 2267 2268 // -------------------------------------------------------------------------- 2269 // 2270 // Function 2271 // Name: BackupQueries::CommandUsageDisplayEntry(const char *, int64_t, int64_t, int32_t) 2261 CommandUsageDisplayEntry("Used", usage->GetBlocksUsed(), hardLimit, 2262 blockSize, MachineReadable); 2263 CommandUsageDisplayEntry("Old files", usage->GetBlocksInOldFiles(), 2264 hardLimit, blockSize, MachineReadable); 2265 CommandUsageDisplayEntry("Deleted files", usage->GetBlocksInDeletedFiles(), 2266 hardLimit, blockSize, MachineReadable); 2267 CommandUsageDisplayEntry("Directories", usage->GetBlocksInDirectories(), 2268 hardLimit, blockSize, MachineReadable); 2269 CommandUsageDisplayEntry("Soft limit", usage->GetBlocksSoftLimit(), 2270 hardLimit, blockSize, MachineReadable); 2271 CommandUsageDisplayEntry("Hard limit", hardLimit, hardLimit, blockSize, 2272 MachineReadable); 2273 } 2274 2275 2276 // -------------------------------------------------------------------------- 2277 // 2278 // Function 2279 // Name: BackupQueries::CommandUsageDisplayEntry(const char *, 2280 // int64_t, int64_t, int32_t, bool) 2272 2281 // Purpose: Display an entry in the usage table 2273 2282 // Created: 19/4/04 2274 2283 // 2275 2284 // -------------------------------------------------------------------------- 2276 void BackupQueries::CommandUsageDisplayEntry(const char *Name, int64_t Size, int64_t HardLimit, int32_t BlockSize) 2277 { 2278 std::cout << FormatUsageLineStart(Name, false) << 2279 FormatUsageBar(Size, Size * BlockSize, HardLimit * BlockSize, false) << 2280 std::endl; 2285 void BackupQueries::CommandUsageDisplayEntry(const char *Name, int64_t Size, 2286 int64_t HardLimit, int32_t BlockSize, bool MachineReadable) 2287 { 2288 std::cout << FormatUsageLineStart(Name, MachineReadable) << 2289 FormatUsageBar(Size, Size * BlockSize, HardLimit * BlockSize, 2290 MachineReadable) << std::endl; 2281 2291 } 2282 2292 -
box/trunk/bin/bbackupquery/BackupQueries.h
r2283 r2353 59 59 void CommandDelete(const std::vector<std::string> &args, 60 60 const bool *opts); 61 void CommandUsage( );61 void CommandUsage(const bool *opts); 62 62 void CommandUsageDisplayEntry(const char *Name, int64_t Size, 63 int64_t HardLimit, int32_t BlockSize );63 int64_t HardLimit, int32_t BlockSize, bool MachineReadable); 64 64 void CommandHelp(const std::vector<std::string> &args); 65 65 -
box/trunk/bin/bbackupquery/documentation.txt
r2283 r2353 143 143 < 144 144 145 > usage 145 > usage [-m] 146 146 147 147 Show space used on the server for this account. 148 149 -m -- display the output in machine-readable form 148 150 149 151 Used: Total amount of space used on the server.
Note: See TracChangeset
for help on using the changeset viewer.
