Skip to content

Support a default help flag. #22

@impguard

Description

@impguard

It would be nice if we could support a help flag for each bake task. Currently, I created a helper shell script to handle this:

bake_task init "generate initial files"
function init () {
    util:help "$@" "$(cat <<EOM
Usage: bake init

Sets up the environment:

   * creates default credentials
   * sets up test fixtures
EOM
)"
    ....
}
function util:help () {
    local usage="${@:$#} "

    while getopts "h" opt; do
        case "$opt" in
            h)
                echo "$usage"
                exit 2
                ;;
        esac
    done
}

This works fine, but would love if the overhead of this was built into bake. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions