]> git.tuebingen.mpg.de Git - gsu.git/blobdiff - misc/gsu/subcommand
gsu: Document gsu().
[gsu.git] / misc / gsu / subcommand
index a04b8dece11660f1b95946c8108f5f9ceacf8a76..6b5df0a37c2a676c7c86d74c5a07371fddd2e1bf 100644 (file)
@@ -513,6 +513,21 @@ gsu_get_unnamed_arg_num()
        result="$(($n - 1))"
 }
 
+# Entry point for all gsu-based scripts.
+#
+# The startup part of the application script should source this file to load
+# the functions defined here, and then call gsu(). Functions starting with com_
+# are automatically recognized as subcommands.
+#
+# Minimal example:
+#
+#      com_hello()
+#      {
+#              echo 'hello world'
+#      }
+#      gsu_dir=${gsu_dir:-/system/location/where/gsu/is/installed}
+#      . $gsu_dir/subcommand || exit 1
+#      gsu "$@"
 gsu()
 {
        local i