File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ tutorial_directory=${BASH_SOURCE[0]%/* }
4+
5+ # This script creates a custom (volatile) bashrc that will basically
6+ # just enable programmable completion for other tutorial scripts and
7+ # invoke an interactive shell
8+ read -N 4096 bashrc << EOF
9+ shopt -s progcomp sourcepath
10+ PATH="$PATH :$tutorial_directory "
11+ . "$tutorial_directory /../argsparse-completion.sh"
12+ complete -F _argsparse_complete \
13+ 1-basics 2-values 3-cumulative-options \
14+ 4-types 5-custom-types 6-properties \
15+ 7-value-checking 8-setting-hook 9-misc
16+
17+ cd "$tutorial_directory " || exit
18+
19+ printf "You are currently in %s directory and completion is enabled.\\\\ n" \
20+ "$tutorial_directory "
21+ printf "Try:\\ \n\\\\ n./1-basics -<tab><tab>\\\\ n\\\\ n"
22+ EOF
23+ exec bash --rcfile <( printf %s " $bashrc " ) -i
You can’t perform that action at this time.
0 commit comments