diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-20 13:45:47 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-12-20 13:45:47 +0100 |
commit | 12cdf2d55775ee671968977d890f9a4d7ba95f1f (patch) | |
tree | 2989ffca116cf0117f65b2b3727af767047a20cb | |
parent | a598e6f48d740619da60d59a10d7c3945f312563 (diff) |
allow procedures to add stuff to usage output
-rwxr-xr-x | src/aif.sh | 7 | ||||
-rw-r--r-- | src/core/procedures/automatic | 3 |
2 files changed, 8 insertions, 2 deletions
@@ -22,6 +22,8 @@ If the procedurename is prefixed with '<modulename>/' it will be loaded from use Available procedures on the filesystem: `find /home/arch/aif/core/procedures -type f`\n `find /home/arch/aif/user/*/procedures -type f 2>/dev/null`" + [ -z "$procedure" ] && msg="$msg\nProcedure ($procedure) specific options:\n$var_ARGS_USAGE" + echo -e "$msg" } @@ -275,8 +277,9 @@ procedure= # in that case -p needs to be the first option, but that's doable imho # an alternative would be to provide an argumentstring for the profile. eg aif -p profile -a "-a a -b b -c c" -var_OPTS_STRING="" # you can override this variable in your procedure. - +# you can override these variables in your procedures +var_OPTS_STRING="" +var_ARGS_USAGE="" # Processes args that were not already matched by the basic rules. process_args () diff --git a/src/core/procedures/automatic b/src/core/procedures/automatic index cdda847..ad279ce 100644 --- a/src/core/procedures/automatic +++ b/src/core/procedures/automatic @@ -4,11 +4,14 @@ # In theory, the only manual thing should maybe be configuring the runtime network # TODO: I don't know if you can do non-interactive dm_crypt stuff.. maybe by pulling luks keyfiles from svn/git/..? +# TODO: check_is_in <somestuff> runtime packages and check needed args, if not known ask (eg svn password) depend_module yaourt depend_procedure core base var_OPTS_STRING="c:" +var_ARGS_USAGE="-c <config>: Specify a configfile (profile) to be used (Mandatory)" # TODO: don't check if the option is specified, but do checking on all variables that we need + process_args () { [ "$1" = '-c' ] |