Use subfolders for each implementation.

This commit is contained in:
Renato Silva 2014-12-02 22:02:45 -02:00
parent 4738b1260c
commit 247778b867
8 changed files with 6 additions and 5 deletions

View File

@ -20,8 +20,9 @@
## used instead. Short version is not available in this ## used instead. Short version is not available in this
## format. ## format.
source easyoptions || exit # Ruby implementation script_dir=$(dirname "$BASH_SOURCE")
# source easyoptions.sh || exit # Bash implementation, slower source "${script_dir}/../easyoptions" || exit # Ruby implementation
# source "${script_dir}/easyoptions.sh" || exit # Bash implementation, slower
# Boolean and parameter options # Boolean and parameter options
[[ -n "$some_option" ]] && echo "Option specified: --some-option" [[ -n "$some_option" ]] && echo "Option specified: --some-option"

View File

@ -24,4 +24,4 @@
## ##
script_dir=$(dirname "$BASH_SOURCE") script_dir=$(dirname "$BASH_SOURCE")
eval "$(PATH="$PATH:/usr/lib/ruby/vendor_ruby:${script_dir}" from="$0" easyoptions.rb "$@" || echo exit 1)" eval "$(PATH="$PATH:/usr/lib/ruby/vendor_ruby:${script_dir}/ruby" from="$0" easyoptions.rb "$@" || echo exit 1)"

View File

@ -6,8 +6,8 @@ mkdir -p "$where" || exit
if [[ "$2" != --remove ]]; then if [[ "$2" != --remove ]]; then
cp -v "$from/easyoptions" "$where" cp -v "$from/easyoptions" "$where"
cp -v "$from/easyoptions.sh" "$where" cp -v "$from/bash/easyoptions.sh" "$where"
cp -v "$from/easyoptions.rb" "$where" cp -v "$from/ruby/easyoptions.rb" "$where"
else else
rm -vf "$where/easyoptions" rm -vf "$where/easyoptions"
rm -vf "$where/easyoptions.sh" rm -vf "$where/easyoptions.sh"