Add subcommand argument example

This commit is contained in:
mitchell 2020-09-29 01:58:59 -04:00
parent 56e4583314
commit cbb5b0202b
1 changed files with 10 additions and 5 deletions

15
run
View File

@ -25,22 +25,27 @@ function run_lang -a command
run_hello run_hello
end end
function lang_fr function lang_fr -a name
echo 'bonjour, le monde!' if test -n "$name"
echo "bounjour, $name!"
else
echo 'bonjour, le monde!'
end
end end
execute_command 'lang' $command execute_command 'lang' $command
end end
### Command Execution ### ### Command Execution ###
# Do not edit, unless you want to alter how to script executes commands. # Do not edit, unless you want to alter how the script executes commands.
# #
# This script can execute 1 or more commands like makefile. It can also receive 1 argument per # This script can execute 1 or more commands like make. It can also receive 1 argument per
# command in the following format: {name}{run_arg_delimeter}{argument}. # command or subcommand in the following format: {name}{run_arg_delimeter}{argument}.
# #
# Examples: # Examples:
# ./run hello # ./run hello
# ./run hey:mitchell # ./run hey:mitchell
# ./run lang:fr:mitchell
# ./run hello hey:mitchell lang:fr # ./run hello hey:mitchell lang:fr
# #
function main function main