Une lib de log simple d'utilisation nécéssitant gint.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

89 lines
884 B

#! /bin/bash
#
# Basic configuration
#
output="Makefile.cfg"
#
# Help screen
#
help()
{
cat << EOF
Configuration script for the log library.
Usage: $0 [options...]
Specified target :
--fxcg50
--fx9680g
If you don't send any option, fxcg50 is set as default
EOF
exit 0
}
if [[ "$@" == "--help" ]]; then
help
exit 1
fi
#
# Parsing arguments
#
model=
fail=false
for arg; do case "$arg" in
-h | -? | --help)
help;;
--fx9860g)
model=fx;;
--fxcg50)
model=cg;;
*)
echo "error: unrecognized argument '$arg'";
fail=true;;
esac; done
#
# Checking mandatory arguments
#
if $fail; then
echo "Oops ! Maybe a wrong option..."
exit 1
fi
#
# Output config
#
output_config()
{
echo -n "MODEL ="
echo -n " $(echo $model)"
echo ""
}
output_config > $output
echo "Configuration saved in $output, ready to make!"