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
## format.
source easyoptions || exit # Ruby implementation
# source easyoptions.sh || exit # Bash implementation, slower
script_dir=$(dirname "$BASH_SOURCE")
source "${script_dir}/../easyoptions" || exit # Ruby implementation
# source "${script_dir}/easyoptions.sh" || exit # Bash implementation, slower
# Boolean and parameter options
[[ -n "$some_option" ]] && echo "Option specified: --some-option"

View File

@ -24,4 +24,4 @@
##
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
cp -v "$from/easyoptions" "$where"
cp -v "$from/easyoptions.sh" "$where"
cp -v "$from/easyoptions.rb" "$where"
cp -v "$from/bash/easyoptions.sh" "$where"
cp -v "$from/ruby/easyoptions.rb" "$where"
else
rm -vf "$where/easyoptions"
rm -vf "$where/easyoptions.sh"