From 4aca0ae67a3291671cca5894e49f8218e884c54f Mon Sep 17 00:00:00 2001 From: Renato Silva Date: Thu, 11 Sep 2014 16:45:28 -0300 Subject: [PATCH] New Bash front end to the Ruby implementation. The pure Bash implementation is now installed as easyoptions.sh instead of just easyoptions, which is now a front end to the Ruby implementation. --- easyoptions | 26 ++++++++++++++++++++++++++ install.sh | 4 +++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 easyoptions diff --git a/easyoptions b/easyoptions new file mode 100644 index 0000000..9615eb5 --- /dev/null +++ b/easyoptions @@ -0,0 +1,26 @@ +#!/bin/bash + +## +## EasyOptions Bash Front End 2014.9.11 +## Copyright (c) 2014 Renato Silva +## GNU GPLv2 licensed +## +## This is the Bash front end for EasyOptions. It is just a wrapper to the +## default implementation for Bash scripts, which is currently Ruby. The pure +## Bash implementation is available as easyoptions.sh. This wrapper makes usage +## cleaner and implementation-agnostic: +## +## source easyoptions || exit +## +## Ruby is currently also the reference implementation, meaning this is the main +## focus of development. However the idea is that new features are applied to +## all implementations. For knowing how up-to-date with the reference an +## implementation is, please refer to the commit log for the source code +## repository. For help about using EasyOptions, please refer to the +## corresponding implementation: +## +## easyoptions.sh --help +## easyoptions.rb --help +## + +eval "$(from="$0" easyoptions.rb "$@" || echo exit 1)" diff --git a/install.sh b/install.sh index b34ae67..183110e 100644 --- a/install.sh +++ b/install.sh @@ -3,9 +3,11 @@ from=$(dirname "$0") if [[ "$1" != --remove ]]; then - cp -v "$from/easyoptions.sh" /usr/local/bin/easyoptions + cp -v "$from/easyoptions" /usr/local/bin + cp -v "$from/easyoptions.sh" /usr/local/bin cp -v "$from/easyoptions.rb" /usr/local/bin else rm -vf /usr/local/bin/easyoptions + rm -vf /usr/local/bin/easyoptions.sh rm -vf /usr/local/bin/easyoptions.rb fi