stylemistake / bash-module

Module system for Bash
Other
5 stars 0 forks source link

Default export #2

Open stylemistake opened 9 years ago

stylemistake commented 9 years ago

Default function to run when calling module, e.g.:

# main.sh

module import foo
module import bar from foo

foo # -> foo!
foo bar # -> foo!
bar # -> bar!
# foo.sh

module export foo default
module export foo
module export bar

foo() {
    echo 'foo!'
}

bar() {
    echo 'bar!'
}