#! /bin/bash
# Last edited on 2024-12-30 15:36:31 by stolfi
# Preamble to be sourced (not executed!) by "rsync" scripts

extraops=()
while [[ ( $# -gt 0 ) && ( "/$1" =~ /- ) ]]; do
  if [[ "/$1" == "/-n" ]]; then
    extraops=( "${extraops[@]}" "$1" ) ; shift
  elif [[ "/$1" == "/-i" ]]; then
    extraops=( "${extraops[@]}" "$1" ) ; shift
  elif [[ "/$1" =~ ^/--exclude ]]; then
    extraops=( "${extraops[@]}" "$1" ) ; shift
  elif [[ "/$1" =~ ^/--include ]]; then
    extraops=( "${extraops[@]}" "$1" ) ; shift
  else
    echo "** unknown option '$1'" 1>&2; exit 1
  fi
done
