Merge lp:~robru/phablet-tools/fix-help into lp:phablet-tools

Proposed by Robert Bruce Park on 2015-09-25
Status: Merged
Approved by: Robert Bruce Park on 2015-09-25
Approved revision: 342
Merged at revision: 343
Proposed branch: lp:~robru/phablet-tools/fix-help
Merge into: lp:phablet-tools
Diff against target: 66 lines (+6/-16)
1 file modified
citrain (+6/-16)
To merge this branch: bzr merge lp:~robru/phablet-tools/fix-help
Reviewer Review Type Date Requested Status
Robert Bruce Park (community) Approve on 2015-09-25
Review via email: mp+272458@code.launchpad.net

Commit Message

Improve helpfulness of help output.

Description of the Change

Improve helpfulness of help output.

To post a comment you must log in.
Robert Bruce Park (robru) wrote :

String changes only and tested by me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'citrain'
2--- citrain 2015-05-07 15:24:45 +0000
3+++ citrain 2015-09-25 18:08:37 +0000
4@@ -17,6 +17,7 @@
5 usage () {
6 cat <<EOF
7 usage: $0 COMMAND SILO-NUMBER [DEVICE-PASSWORD] [DISTRIBUTION]
8+$1
9
10 COMMANDS:
11 host-install Deprecated. Please use host-upgrade instead.
12@@ -26,9 +27,6 @@
13 host-purge Uses ppa-purge to uninstall the silo contents from the host machine.
14 device-purge Not implemented.
15
16-SILO-NUMBER:
17- 0..30
18-
19 DISTRIBUTION: (optional)
20 ubuntu
21 ubuntu-rtm
22@@ -50,24 +48,16 @@
23
24 # Read the first positional argument.
25 COMMAND="$1"
26-[ $# -gt 0 ] && shift || usage
27+[ $# -gt 0 ] && shift || usage "Missing COMMAND"
28
29 # Check that silo number is really a number.
30-echo "$1" | egrep -q "^[0-9]{1,3}$" || usage
31+echo "$1" | egrep -q "^[0-9]{1,3}$" || usage "SILO-NUMBER not a number."
32
33 # Read the second positional argument.
34 SILO=landing-$(echo "000$1" | rev | cut -c -3 | rev)
35-[ $# -gt 0 ] && shift || usage
36+[ $# -gt 0 ] && shift || usage "Missing SILO-NUMBER."
37
38 case "$COMMAND" in
39- host-install)
40- usage
41- ;;
42-
43- device-install)
44- usage
45- ;;
46-
47 host-upgrade)
48 set -x
49 sudo add-apt-repository $PPA/$SILO
50@@ -79,7 +69,7 @@
51 check_devices
52 # Read the third positional argument.
53 PASSWORD="$1"
54- [ $# -gt 0 ] && shift || usage
55+ [ $# -gt 0 ] && shift || usage "Missing DEVICE-PASSWORD"
56
57 set -x
58 adb shell egrep ^deb /etc/apt/sources.list.d/\*.list
59@@ -114,6 +104,6 @@
60 ;;
61
62 *)
63- usage
64+ usage "Unknown COMMAND."
65 ;;
66 esac

Subscribers

People subscribed via source and target branches