Skip to content

Commit

Permalink
Created a tickReset function, to reset TickTick to initial state with…
Browse files Browse the repository at this point in the history
… no JSON. Mentioned in README.
  • Loading branch information
XLTechie committed May 14, 2020
1 parent 7a366e0 commit 91c3321
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ Miscellaneous
#### tickVars - see the currently defined variables
* Show all variables: You can see the current values defined in the TickTick world with the `tickVars` routine.

#### tickReset - clear the currently defined variables
* Clear all variables: You can erace any JSON you have created/imported with the `tickReset` routine.

#### __tick_var_debug - See the interim bash code
* Dry run (display compiled code): TickTick is a mini-compiler that emits bash. If you declare `extern __tick_var_debug=1` at the top of your code, then the code will not run but instead print what it would have run.

Expand Down
6 changes: 6 additions & 0 deletions ticktick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,12 @@ if [[ $__tick_var_tokenized ]]; then
set | grep ^__tick_data | sed s/__tick_data_/" "/
echo
}

tickReset() {
for var in `set | sed -nr 's/^(__tick_data_[^=]+).*/\1/p'`
do unset "$var"
done
}
else
__tick_fun_tokenize
fi

0 comments on commit 91c3321

Please sign in to comment.