summaryrefslogtreecommitdiff
path: root/fastboot/fastboot.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-04-02 20:47:53 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-04-02 20:47:53 +0000
commit194e27bf5e1c10b504781a06fabe19571b79c3dc (patch)
tree158f186b4bf7d0dd0420b409b42f0fa8037c3c4b /fastboot/fastboot.cpp
parentb7ba61ffc55c6caa359c97ad364f5c06f92c41e6 (diff)
parentf238d8751b9960362ae0cf7e5476ab510461db9d (diff)
Merge "Modernize fastboot output format."
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r--fastboot/fastboot.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 237f08170..7a30aeea6 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -95,6 +95,7 @@ static unsigned tags_offset = 0x00000100;
static bool g_disable_verity = false;
static bool g_disable_verification = false;
+static bool g_verbose = false;
static const std::string convert_fbe_marker_filename("convert_fbe");
@@ -426,7 +427,7 @@ static int show_help() {
" trigger a reboot.\n"
" --disable-verity Set the disable-verity flag in the\n"
" the vbmeta image being flashed.\n"
- " --disable-verification Set the disable-verification flag in"
+ " --disable-verification Set the disable-verification flag in\n"
" the vbmeta image being flashed.\n"
#if !defined(_WIN32)
" --wipe-and-use-fbe On devices which support it,\n"
@@ -434,6 +435,7 @@ static int show_help() {
" enable file-based encryption\n"
#endif
" --unbuffered Do not buffer input or output.\n"
+ " -v, --verbose Verbose output.\n"
" --version Display version.\n"
" -h, --help show this message.\n"
);
@@ -783,8 +785,8 @@ static int64_t get_target_sparse_limit(Transport* transport) {
fprintf(stderr, "couldn't parse max-download-size '%s'\n", max_download_size.c_str());
return 0;
}
- if (limit > 0) {
- fprintf(stderr, "target reported max download size of %" PRId64 " bytes\n", limit);
+ if (g_verbose && limit > 0) {
+ fprintf(stderr, "Target reported max download size of %" PRId64 " bytes\n", limit);
}
return limit;
}
@@ -1517,12 +1519,13 @@ int main(int argc, char **argv)
{"tags-offset", required_argument, 0, 't'},
{"help", no_argument, 0, 'h'},
{"unbuffered", no_argument, 0, 0},
- {"version", no_argument, 0, 0},
{"slot", required_argument, 0, 0},
{"set_active", optional_argument, 0, 'a'},
{"set-active", optional_argument, 0, 'a'},
{"skip-secondary", no_argument, 0, 0},
{"skip-reboot", no_argument, 0, 0},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 0},
{"disable-verity", no_argument, 0, 0},
{"disable-verification", no_argument, 0, 0},
#if !defined(_WIN32)
@@ -1534,7 +1537,7 @@ int main(int argc, char **argv)
serial = getenv("ANDROID_SERIAL");
while (1) {
- int c = getopt_long(argc, argv, "wub:k:n:r:t:s:S:lc:i:m:ha::", longopts, &longindex);
+ int c = getopt_long(argc, argv, "vwub:k:n:r:t:s:S:lc:i:m:ha::", longopts, &longindex);
if (c < 0) {
break;
}
@@ -1589,6 +1592,9 @@ int main(int argc, char **argv)
case 'u':
erase_first = false;
break;
+ case 'v':
+ g_verbose = true;
+ break;
case 'w':
wants_wipe = true;
break;