Add help command.
This commit is contained in:
parent
253ae30746
commit
44d7def8d4
24
isidore.sh
24
isidore.sh
@ -23,6 +23,8 @@ ISIDORE_CONFIG_DIR_OPTIONS=(
|
||||
"$HOME/.isidore")
|
||||
ISIDORE_AUTHOR_NAME=""
|
||||
|
||||
PROG_NAME=$0
|
||||
|
||||
##
|
||||
# Create the configuration file. This function is called if it does not already
|
||||
# exist.
|
||||
@ -76,7 +78,23 @@ function set_config_vars()
|
||||
##
|
||||
function print_usage()
|
||||
{
|
||||
echo "USAGE: $1 <command> [options]"
|
||||
echo "USAGE: $PROG_NAME <command> [options]"
|
||||
}
|
||||
|
||||
function print_help()
|
||||
{
|
||||
print_usage
|
||||
echo -e "\nCOMMANDS:
|
||||
new <dir> <name>
|
||||
Create a new Isidore project
|
||||
build
|
||||
Build the project rooted in the current directory
|
||||
clean
|
||||
Clean the built files
|
||||
version
|
||||
Print the current version
|
||||
help
|
||||
Show this help information"
|
||||
}
|
||||
|
||||
##
|
||||
@ -133,7 +151,9 @@ case $1 in
|
||||
new_project $2 $3;;
|
||||
clean)
|
||||
clean_project;;
|
||||
help)
|
||||
print_help;;
|
||||
*)
|
||||
echo "Unknown command $1. Use the 'help' command."
|
||||
print_usage $0;;
|
||||
print_usage;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user