Usage function

This commit is contained in:
Tiago Almeida 2019-11-02 21:15:04 +00:00
parent 8442d3ad35
commit e1bba94e7b
2 changed files with 46 additions and 4 deletions

View File

@ -22,11 +22,46 @@ OPTERR=1
IFS=" "
# Global Variables
G_VERSION="1.0.0"
G_NANORC_FILE="~/.nanorc"
G_DEPS="unzip sed wget"
# Exit Values Help
# 0 - OK
# 1 - Small problem
# 2 - Big problem
# Functions
# Show the usage/help
f_menu_usage(){
echo "Usage: $0 [ -l|-v|-h ] [ -f FILE ]"
echo "IMPROVED NANO SYNTAX HIGHLIGHTING FILES"
echo "Get nano editor better to use and see."
echo
echo "-l Activate lite installation."
echo "-v Show version, license and other info."
echo "-h Show help or usage."
echo "-f FILE Other file instead of the default .nanorc file."
exit 2
}
# Show version, license and other file.
f_menu_version(){
echo "IMPROVED NANO SYNTAX HIGHLIGHTING FILES"
echo "Version ${G_VERSION}"
echo
echo "Copyright (C) 2014+ Anthony Scopatz et al."
echo "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>."
echo "This is free software: you are free to change and redistribute it."
echo "There is NO WARRANTY, to the extent permitted by law."
echo
echo "Written by Anthony Scopatz and others."
exit 0
}
# Check dependencies
f_check_deps(){
DEPS_MISSED=""
@ -76,10 +111,17 @@ _update_nanorc_lite(){
}
# check parameters
# corewct the get ifs
# check parameters with getopts
# help version license+info output bugs report
# init main
# get the git
# updat/create the nanorc
# Main / Init of script
f_check_deps
case "$1" in

View File

@ -1,10 +1,7 @@
# TODO
0. write the scheme of the program in install file
0. https://spdx.org/licenses/GPL-3.0-or-later.html
make comments with a space after? in sh or bash
0. Create the other theme files accordingly the original.
0. The themes files is only for sed.
0. Make nanorc more beautiful.
@ -12,3 +9,6 @@ make comments with a space after? in sh or bash
1. Combine original files with project files.
2. See if there is any command to check the atual version of nano (to update the files BEFORE a release).
4. Make the install file the oficial installaton and update it accordingly.
0. make the installation with more plesant wait
0. may be begin with version system 1.0.0 ...