]> git.phdru.name Git - dotfiles.git/commitdiff
.shellrc: Allow to path arguments to `include`
authorOleg Broytman <phd@phdru.name>
Thu, 27 Aug 2020 00:14:58 +0000 (03:14 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 27 Aug 2020 00:14:58 +0000 (03:14 +0300)
.shellrc

index 167af7b5c4e4cf95101a977adf42d585f468228c..7388d5a59743eb30f696805401708f4ed5f5c751 100644 (file)
--- a/.shellrc
+++ b/.shellrc
@@ -330,12 +330,13 @@ fi
 
 include() {
    cfg="$1"
+   shift
    if [ -f "./$cfg" -a -r "./$cfg" ]; then
       echo "Reading config file \`$cfg'" 1>&2
-      . "./$cfg"
+      . "./$cfg" "$@"
    elif [ -f "$HOME/lib/config/$cfg" -a -r "$HOME/lib/config/$cfg" ]; then
       echo "Reading config file \`$HOME/lib/config/$cfg'" 1>&2
-      . "$HOME/lib/config/$cfg"
+      . "$HOME/lib/config/$cfg" "$@"
    else
       echo "Cannot find config file \`$cfg'" 1>&2
    fi