Last active
August 29, 2015 13:57
-
-
Save alganet/9419469 to your computer and use it in GitHub Desktop.
Prototype for Mosai Script Tools 1.0. Works on sh, bash, ksh, zsh, and cmd on Windows and Wine! No dependencies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
scrito () ( : ) | |
# Static version information | |
scrito_v () ( scrito_version ) | |
scrito_version () ( echo "Mosai Script Tools 1.0" 1>&2 ) | |
# Short help text | |
scrito_h () ( scrito_help ) | |
scrito_help () | |
{ | |
cat <<-HELP | |
Usage: scrito [TOOL] | |
scrito help | |
scrito version | |
scrito -h | |
scrito -v | |
HELP | |
} | |
tool=$1 | |
tool=${tool##*-} | |
tool=${tool##*/} | |
[ -z $tool ] || scrito_${tool} $@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off >NUL | |
set tool=%1 | |
set tool=%tool:-=% | |
set tool=%tool:/=% | |
if not "%tool%" == "-=" call :scrito_%tool% %* | |
:scrito | |
exit /b | |
:: Static version information | |
:scrito_v | |
:scrito_version | |
echo Mosai Script Tools 1.0 1>&2 | |
exit /b | |
:: Short help text | |
:scrito_h | |
:scrito_help | |
echo Usage: scrito [TOOL] | |
echo scrito help | |
echo scrito version | |
echo scrito -h | |
echo scrito -v | |
exit /b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment