From b7039f514b4c1481dc384760ce9893def4fb0b71 Mon Sep 17 00:00:00 2001 From: Zach Klippenstein Date: Sat, 7 May 2016 18:00:26 -0700 Subject: [PATCH] [cmd/adb] Formatted flag definitions. --- .travis.yml | 4 ++++ cmd/adb/main.go | 55 +++++++++++++++++++++++++++++++++++++------------ 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index e7efe16..8fa29de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,3 +3,7 @@ language: go go: - 1.6 - tip + +install: + # Needed for tip (394ac81) + - go get -t -v ./... diff --git a/cmd/adb/main.go b/cmd/adb/main.go index 421a701..39ba8f7 100644 --- a/cmd/adb/main.go +++ b/cmd/adb/main.go @@ -17,23 +17,52 @@ import ( const StdIoFilename = "-" var ( - serial = kingpin.Flag("serial", "Connect to device by serial number.").Short('s').String() + serial = kingpin.Flag("serial", + "Connect to device by serial number."). + Short('s'). + String() - shellCommand = kingpin.Command("shell", "Run a shell command on the device.") - shellCommandArg = shellCommand.Arg("command", "Command to run on device.").Strings() + shellCommand = kingpin.Command("shell", + "Run a shell command on the device.") + shellCommandArg = shellCommand.Arg("command", + "Command to run on device."). + Strings() - devicesCommand = kingpin.Command("devices", "List devices.") - devicesLongFlag = devicesCommand.Flag("long", "Include extra detail about devices.").Short('l').Bool() + devicesCommand = kingpin.Command("devices", + "List devices.") + devicesLongFlag = devicesCommand.Flag("long", + "Include extra detail about devices."). + Short('l'). + Bool() - pullCommand = kingpin.Command("pull", "Pull a file from the device.") - pullProgressFlag = pullCommand.Flag("progress", "Show progress.").Short('p').Bool() - pullRemoteArg = pullCommand.Arg("remote", "Path of source file on device.").Required().String() - pullLocalArg = pullCommand.Arg("local", "Path of destination file. If -, will write to stdout.").String() + pullCommand = kingpin.Command("pull", + "Pull a file from the device.") + pullProgressFlag = pullCommand.Flag("progress", + "Show progress."). + Short('p'). + Bool() + pullRemoteArg = pullCommand.Arg("remote", + "Path of source file on device."). + Required(). + String() + pullLocalArg = pullCommand.Arg("local", + "Path of destination file. If -, will write to stdout."). + String() - pushCommand = kingpin.Command("push", "Push a file to the device.") - pushProgressFlag = pushCommand.Flag("progress", "Show progress.").Short('p').Bool() - pushLocalArg = pushCommand.Arg("local", "Path of source file. If -, will read from stdin.").Required().String() - pushRemoteArg = pushCommand.Arg("remote", "Path of destination file on device.").Required().String() + pushCommand = kingpin.Command("push", + "Push a file to the device.") + pushProgressFlag = pushCommand.Flag("progress", + "Show progress."). + Short('p'). + Bool() + pushLocalArg = pushCommand.Arg("local", + "Path of source file. If -, will read from stdin."). + Required(). + String() + pushRemoteArg = pushCommand.Arg("remote", + "Path of destination file on device."). + Required(). + String() ) var server adb.Server