changed getargs to gettoks

now it’s more general, we can use the same function for determining
pipes & redirects!