diff --git a/easyoptions.sh b/bash/easyoptions.sh similarity index 100% rename from easyoptions.sh rename to bash/easyoptions.sh diff --git a/example.sh b/bash/example.sh similarity index 87% rename from example.sh rename to bash/example.sh index 3127215..0700d24 100644 --- a/example.sh +++ b/bash/example.sh @@ -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" diff --git a/easyoptions b/easyoptions index 7c4e0d5..c7c9f9a 100644 --- a/easyoptions +++ b/easyoptions @@ -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)" diff --git a/install.sh b/install.sh index c83a48c..13e98d5 100644 --- a/install.sh +++ b/install.sh @@ -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" diff --git a/.rubocop.yml b/ruby/.rubocop.yml similarity index 100% rename from .rubocop.yml rename to ruby/.rubocop.yml diff --git a/easyoptions.gemspec b/ruby/easyoptions.gemspec similarity index 100% rename from easyoptions.gemspec rename to ruby/easyoptions.gemspec diff --git a/easyoptions.rb b/ruby/easyoptions.rb similarity index 100% rename from easyoptions.rb rename to ruby/easyoptions.rb diff --git a/example.rb b/ruby/example.rb similarity index 100% rename from example.rb rename to ruby/example.rb