Modernize fastboot output format.

After:

  --------------------------------------------
  Bootloader Version...: 0.5
  Baseband Version.....: 0.5
  Serial Number........: serialv1.0
  --------------------------------------------
  Checking product                                   OKAY [  0.032s]
  Sending 'boot' (9962 KB)                           OKAY [  0.350s]
  Writing 'boot'                                     OKAY [  0.143s]
  Sending 'dts' (14 KB)                              OKAY [  0.068s]
  Writing 'dts'                                      OKAY [  0.048s]
  Sending sparse 'system' 1/2 (460796 KB)            OKAY [ 14.383s]
  Writing sparse 'system' 1/2                        OKAY [  4.138s]
  Sending sparse 'system' 2/2 (443712 KB)            OKAY [ 13.871s]
  Writing sparse 'system' 2/2                        OKAY [  3.246s]
  Rebooting
  Finished. Total time: 36.962s

For a failure:

  extracting android-info.txt (0 MB) to RAM...
  --------------------------------------------
  Bootloader Version...: 0.5
  Baseband Version.....: 0.5
  Serial Number........: serialv1.0
  --------------------------------------------
  Checking product                                   FAILED

  Device product is 'hikey960'.
  Update requires 'marlin' or 'sailfish'.

  fastboot: error: requirements not met!

This change also adds a -v/--verbose flag, but doesn't make much use of
it yet (http://b/30953083 will need it).

Bug: N/A
Test: manual
Change-Id: I7d19f5775859ffad5f3be5707b37dcb6e180917f
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 237f081..7a30aee 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -95,6 +95,7 @@
 
 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 @@
             "                                           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 @@
             "                                           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 @@
         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 @@
         {"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 @@
     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 @@
         case 'u':
             erase_first = false;
             break;
+        case 'v':
+            g_verbose = true;
+            break;
         case 'w':
             wants_wipe = true;
             break;