diff options
-rwxr-xr-x | nix-script-repl.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/nix-script-repl.sh b/nix-script-repl.sh index 2f7effb..423f410 100755 --- a/nix-script-repl.sh +++ b/nix-script-repl.sh @@ -85,6 +85,25 @@ __verbosity() { esac } +__debugging() { + case $1 in + on) + export DEBUG=1 + dbg "DEBUG = $DEBUG" + stdout "Debugging is now ON" + ;; + off) + export DEBUG=0 + dbg "DEBUG = $DEBUG" + stdout "Debugging is now ON" + ;; + *) + stderr "Unknown argument: $1" + stderr "Usage: debuggig [on|off]" + ;; + esac +} + __builtin__() { local str=$1; shift local cmd=$1; shift @@ -107,6 +126,7 @@ do __builtin__ "help" usage $ARGS || continue __builtin__ "list" __list $ARGS || continue __builtin__ "verbosity" __verbosity $ARGS || continue + __builtin__ "debugging" __debugging $ARGS || continue dbg "Got '$COMMAND' with args '$ARGS'" stdout "Searching for script for '$COMMAND'" |