diff options
author | Johan Toras Halseth <johanth@google.com> | 2017-04-11 11:49:34 +0100 |
---|---|---|
committer | Johan Toras Halseth <johanth@google.com> | 2017-04-11 11:49:34 +0100 |
commit | 9d5f8e11e11e93fbf0d9cbcbb68b7b0062695e5d (patch) | |
tree | f149fe5a2fc1a38080be1d53a038a1c648782b60 /cmds/bu/src | |
parent | 62abe8f8027ccc5a98133b93582ad23ff0573d0c (diff) |
Add helptext to bu command.
bu is used by adb backup/restore, but since flags passed to these adb
commands are just forwarded to bu, we have no guarantee that the help
text for adb shows an up to date description of what bu can do. We
therefore add the help text to bu, such that it is easier to keep in
sync.
Test: adb shell bu help
Bug: 36170696
Change-Id: I8155d17b5c942ce19b981f4a157e7cc7810490ce
Diffstat (limited to 'cmds/bu/src')
-rw-r--r-- | cmds/bu/src/com/android/commands/bu/Backup.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/cmds/bu/src/com/android/commands/bu/Backup.java b/cmds/bu/src/com/android/commands/bu/Backup.java index ce114fd02475..345895b794a3 100644 --- a/cmds/bu/src/com/android/commands/bu/Backup.java +++ b/cmds/bu/src/com/android/commands/bu/Backup.java @@ -57,7 +57,7 @@ public final class Backup { } else if (arg.equals("restore")) { doRestore(OsConstants.STDIN_FILENO); } else { - Log.e(TAG, "Invalid operation '" + arg + "'"); + showUsage(); } } @@ -158,6 +158,21 @@ public final class Backup { } } + private static void showUsage() { + System.err.println(" backup [-f FILE] [-apk|-noapk] [-obb|-noobb] [-shared|-noshared] [-all]"); + System.err.println(" [-system|-nosystem] [-keyvalue|-nokeyvalue] [PACKAGE...]"); + System.err.println(" write an archive of the device's data to FILE [default=backup.adb]"); + System.err.println(" package list optional if -all/-shared are supplied"); + System.err.println(" -apk/-noapk: do/don't back up .apk files (default -noapk)"); + System.err.println(" -obb/-noobb: do/don't back up .obb files (default -noobb)"); + System.err.println(" -shared|-noshared: do/don't back up shared storage (default -noshared)"); + System.err.println(" -all: back up all installed applications"); + System.err.println(" -system|-nosystem: include system apps in -all (default -system)"); + System.err.println(" -keyvalue|-nokeyvalue: include apps that perform key/value backups."); + System.err.println(" (default -nokeyvalue)"); + System.err.println(" restore FILE restore device contents from FILE"); + } + private String nextArg() { if (mNextArg >= mArgs.length) { return null; |