]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
add comment for getargbool()
authorWill Woods <wwoods@redhat.com>
Fri, 27 Jul 2012 17:12:28 +0000 (13:12 -0400)
committerHarald Hoyer <harald@redhat.com>
Mon, 30 Jul 2012 10:23:32 +0000 (12:23 +0200)
I always forget how getargbool works. Add a comment documenting it.

modules.d/99base/dracut-lib.sh

index 2eb12249fe6ea4b1c2fd57049e58ffb7207e05d2..3a7be9a839d16abd0d82e20e097816c29cf11533 100755 (executable)
@@ -145,6 +145,13 @@ getarg() {
     return 1
 }
 
+# getargbool <defaultval> <args...>
+# False if "getarg <args...>" returns "0", "no", or "off".
+# True if getarg returns any other non-empty string.
+# If not found, assumes <defaultval> - usually 0 for false, 1 for true.
+# example: getargbool 0 rd.info
+#   true: rd.info, rd.info=1, rd.info=xxx
+#   false: rd.info=0, rd.info=off, rd.info not present (default val is 0)
 getargbool() {
     local _b
     unset _b