A tool to create scripts to help and learn command line tools.
# Hashs are used to describe text that will be shown to the user.
#
# !checkfile command checks that a file not exists and allow you to continue the script
!checkfile .git
#
# <bold><green>You can use ANSIMARKUP to format your text</green></bold>
#
## Double hashs mark text that are related and used as a help for the next command/input.
#
# run command prompts the user for a command that match the regex indicated...
run git init$
#
# And then you can check if a file exists:
checkfile .git
#
# You can ask the user to press ENTER to continue
enter
#
# And also automatically create a file (example.txt):
### exemple.txt
Arquivo de exemplo com 3 linhas:
Linha 0
Linha 1
Linha 2
###
#
# You can automatically run a command for the user with run_auto
#
run_auto ls
#
# And allow the user to run any command with run_free
run_free
# Anything to be displayed
Displays a text to the user. You can use ansimarkups to format text.
## Anything to be displayed
TODO A text displayed to the user that can be invoked by the help command.
### filename
file content
may have any number of lines
###
Command to create a file that will include any text from that command until the next ###.
checkfile file_or_directory_to_be_checked if it exists
!checkfile file_or_directory_to_be_checked if it not exists
Checks if a file or directory exists (or not). If condition is not satisfied, the script will stop.
run regex_of_command
Create a user prompt where user must type a command that satisfies the regex passed as argument.
run_auto command
Runs an command automatically as an user would (the prompt and command are displayed to the user).
run_free
Allow user to run any command.
To run tutorterminal execute:
python3 learn_script.py [files]