From 1098785778a242838668df8c45f4a07d1690b06c Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 29 Aug 2014 20:13:13 +0200 Subject: [PATCH] gsu: Document gsu(). To get started, gsu application writers need to know how the gsu() function works. So let's provide a small introduction here and a minimal example. --- misc/gsu/subcommand | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/misc/gsu/subcommand b/misc/gsu/subcommand index a04b8de..6b5df0a 100644 --- a/misc/gsu/subcommand +++ b/misc/gsu/subcommand @@ -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 -- 2.39.2