chiark / gitweb /
Basic completion for init, add --verbose to it
authorDaniel Martí <mvdan@mvdan.cc>
Mon, 4 Nov 2013 19:28:32 +0000 (20:28 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Mon, 4 Nov 2013 19:28:32 +0000 (20:28 +0100)
completion/bash-completion
fdroidserver/init.py

index c6a5ef1393c6be58fd93fc40b07260306be7b499..da678a2ea99817132735e8678efdc72654896a9c 100644 (file)
@@ -183,10 +183,16 @@ __complete_server() {
        __complete_options
 }
 
+__complete_init() {
+       opts="-h -v"
+       lopts="--help --verbose"
+       __complete_options
+}
+
 _fdroid() {
        local cmd cmds aliased
        cmd=${COMP_WORDS[1]}
-       cmds=" build update publish checkupdates import rewritemeta scanner verify stats server "
+       cmds=" build init update publish checkupdates import rewritemeta scanner verify stats server "
        aliased=false
 
        for c in $cmds; do eval "_fdroid_${c} () {
index 6203f67c4518c04137a2f882ca1aeb595857c428..9fe975a3d5483d16a668e115291aab259229288a 100644 (file)
@@ -42,9 +42,13 @@ def write_to_config(key, value):
         f.writelines(data)
 
 def main():
+
+    global options, config
+
     # Parse command line...
-    global options
     parser = OptionParser()
+    parser.add_option("-v", "--verbose", action="store_true", default=False,
+                      help="Spew out even more information than normal")
     (options, args) = parser.parse_args()
 
     # find root install prefix