> just write a single combinator that when applied to a command
> makes it behave in the "no non-flag arguments == dont run" way.
> Then its just:
>
> l0 cat $args
> l0 chmod +x $args
> Tim Newsham
This mostly works, but misses a few cases. For example ln, mv, cp
a possibly empty list of files to a directory. If someone really
wanted to implement this, and I don't, in case that wasn't obvious,
then the most efficient way to do it would be to use your combinator
for most of the cases and handle the others individually.
There is also a problem with identifying non-flag arguments. In
foo -x bar
is bar a non-flag argument or not? You really have to read the
man page of foo to find out whether you are dealing with something
like
foo [-x user ] file ...
or something more like
for [-x] file ...
--
John Stalker
School of Mathematics
Trinity College Dublin
tel +353 1 896 1983
fax +353 1 896 2282