# shellcheck shell=dash

___x_cmd log init sb
xrc:mod:lib     sb   run    airrun  editrun landrun stdiorun


# x plg jq      # very detailed control

# x sb jq       # default, no network, no exec ... no fsys, but with very basic ...
# x sb yq       # default, no network, no exec ...
# x sb          #

___x_cmd_sb___main(){
    [ "$#" -gt 0 ] ||   set -- --help

    local op="$1";      shift
    case "$op" in
        -h|--help)      ___x_cmd help -m sb     "$@"    ;    return 0 ;;
        --|run)         ___x_cmd_sb_run         "$@"    ;;

        airrun)         ___x_cmd_sb_airrun      "$@"    ;;
        editrun)        ___x_cmd_sb_editrun     "$@"    ;;
        stdiorun)       ___x_cmd_sb_stdiorun    "$@"    ;;
                        # only allow reading/writing in the current workdir

        # Auto ...
        snap)           ___x_cmd_sb_snap        "$@"    ;;

        env)            ___x_cmd_sb_env         "$@"    ;;
        try)            ___x_cmd_sb_env try     "$@"    ;;

        *)              ___x_cmd_sb_run "$op"   "$@"    ;;
    esac
}

