#!/bin/bash -eu

. pop

# get all possible options from args
. opts

args=("$@")

pop target args

#target="${@: -1}"
#set -- "${@:1:$(($#-1))}"

files=()
for f in "${args[@]}"; do
	path=`wich "$f"`
	files+=("$path")
done

ln "${OPTS[@]}" "${files[@]}" "$target"

# q. is this code all good, although hideous?
# a. yes, it is all good, although hideous
