Rename executable_name -> _sti_executable

`executable_name' conflicts with a variable used in one of the commands.
To make it clear that it is a special name add a `_' in front of it.
This commit is contained in:
Tom Willemse 2014-03-12 18:13:47 +01:00
parent 3e50206d62
commit 4adc96bfa3

26
sti
View file

@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with sti. If not, see <http://www.gnu.org/licenses/>. # along with sti. If not, see <http://www.gnu.org/licenses/>.
executable_name="$(basename $0)" _sti_executable="$(basename $0)"
data_home="${XDG_DATA_HOME:-${HOME}/.local/share}/sti" data_home="${XDG_DATA_HOME:-${HOME}/.local/share}/sti"
bin_home="${HOME}/usr/bin" bin_home="${HOME}/usr/bin"
@ -66,7 +66,7 @@ function cmd_help
local prefix="help" local prefix="help"
dispatch "$@" dispatch "$@"
else else
echo "Usage: ${executable_name} <command> ARG" echo "Usage: ${_sti_executable} <command> ARG"
echo echo
echo "Commands include: " echo "Commands include: "
echo " help Show this help message" echo " help Show this help message"
@ -76,14 +76,14 @@ function cmd_help
echo " remove Remove an installed tool" echo " remove Remove an installed tool"
echo " update Update an installed tool" echo " update Update an installed tool"
echo echo
echo "You can use \`${executable_name} help <command>' to get \ echo "You can use \`${_sti_executable} help <command>' to get \
more information about a command." | fold more information about a command." | fold
fi fi
} }
function help_list () function help_list ()
{ {
echo "Usage: ${executable_name} list" echo "Usage: ${_sti_executable} list"
echo echo
echo "List all downloaded (possibly installed) tools." | fold echo "List all downloaded (possibly installed) tools." | fold
} }
@ -95,10 +95,10 @@ function cmd_list
function help_reinit () function help_reinit ()
{ {
echo "Usage: ${executable_name} reinit TOOL" echo "Usage: ${_sti_executable} reinit TOOL"
echo echo
echo "TOOL should be the name of a tool installed previously with \ echo "TOOL should be the name of a tool installed previously with \
\`${executable_name} install'. This name is the base name of the URL \ \`${_sti_executable} install'. This name is the base name of the URL \
used to install the tool, with the \`.git' suffix removed." | fold used to install the tool, with the \`.git' suffix removed." | fold
echo echo
echo "Each executable file found in the tool's directory is checked \ echo "Each executable file found in the tool's directory is checked \
@ -118,7 +118,7 @@ function cmd_reinit ()
function help_install () function help_install ()
{ {
echo "Usage: ${executable_name} install URL" echo "Usage: ${_sti_executable} install URL"
echo echo
echo "URL should be a valid argument to \`git clone'." echo "URL should be a valid argument to \`git clone'."
echo echo
@ -150,10 +150,10 @@ function cmd_install ()
function help_remove () function help_remove ()
{ {
echo "Usage: ${executable_name} remove TOOL" echo "Usage: ${_sti_executable} remove TOOL"
echo echo
echo "TOOL should be the name of a tool installed previously with \ echo "TOOL should be the name of a tool installed previously with \
\`${executable_name} install'. This name is the base name of the URL \ \`${_sti_executable} install'. This name is the base name of the URL \
used to install the tool, with the \`.git' suffix removed." | fold used to install the tool, with the \`.git' suffix removed." | fold
echo echo
echo "Any executable files found in the directory of TOOL will have \ echo "Any executable files found in the directory of TOOL will have \
@ -178,15 +178,15 @@ function cmd_remove ()
function help_update function help_update
{ {
echo "Usage: ${executable_name} update TOOL" echo "Usage: ${_sti_executable} update TOOL"
echo echo
echo "TOOL should be the name of a tool installed previously with \ echo "TOOL should be the name of a tool installed previously with \
\`${executable_name} install'. This name is the base name of the URL \ \`${_sti_executable} install'. This name is the base name of the URL \
used to install the tool, with the \`.git' suffix removed." | fold used to install the tool, with the \`.git' suffix removed." | fold
echo echo
echo "This command removes all the executables from \`${data_home}' \ echo "This command removes all the executables from \`${data_home}' \
just as \`${executable_name} remove' would, calls \`git pull' in TOOL's \ just as \`${_sti_executable} remove' would, calls \`git pull' in TOOL's \
directory and then reinstalls the executables as \`${executable_name} \ directory and then reinstalls the executables as \`${_sti_executable} \
reinit' would." reinit' would."
} }