From e1bba94e7be4cef28b99485e0f179365efc74d7e Mon Sep 17 00:00:00 2001 From: Tiago Almeida Date: Sat, 2 Nov 2019 21:15:04 +0000 Subject: [PATCH] Usage function --- install.sh | 44 +++++++++++++++++++++++++++++++++++++++++++- todo.md | 6 +++--- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index ab0778d..23f26e4 100755 --- a/install.sh +++ b/install.sh @@ -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 ." + 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 diff --git a/todo.md b/todo.md index 5f9fb20..c6414d0 100644 --- a/todo.md +++ b/todo.md @@ -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 ...