瀏覽代碼

Check number of arguments when installing to microsd

Bob Mottram 10 年之前
父節點
當前提交
1364ea3298
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11
    0
      src/freedombone-prep

+ 11
- 0
src/freedombone-prep 查看文件

@@ -20,6 +20,9 @@
20 20
 # You should have received a copy of the GNU General Public License
21 21
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 22
 
23
+# The number of arguments
24
+NO_OF_ARGS=$#
25
+
23 26
 # Version number of this script
24 27
 VERSION="1.00"
25 28
 
@@ -45,8 +48,16 @@ function show_help {
45 48
     echo ''
46 49
     echo 'freedombone-prep -d [microSD device] --ip [BBB LAN IP address] --iprouter [Router LAN IP address]'
47 50
     echo ''
51
+    echo 'See the manpage for more details'
52
+    echo ''
48 53
 }
49 54
 
55
+# if no arguments are given
56
+if [[ $NO_OF_ARGS == 0 ]]; then
57
+  show_help
58
+  exit 0
59
+fi
60
+
50 61
 while [[ $# > 1 ]]
51 62
 do
52 63
 key="$1"