port command & arguments

Ryan Schmidt ryandesign at macports.org
Fri Apr 11 01:32:26 PDT 2014


On Apr 11, 2014, at 02:21, René J.V. Bertin wrote:

> On Friday April 11 2014 08:09:36 Jan Stary wrote:
> 
>> 
>> You can easily create aliases in your shell,
>> without any need to touch 'port'.
> 
> An alias subsitution that replaces a certain argument of a given command regardless of what order arguments have been passed, and their order?

That is indeed more complicated. However, due to the fact that MacPorts itself enforces a rather strict order of arguments, it might be a bit simpler.

In my bash startup file, I’ve defined “port” as a function, and then if the next word is one of my custom port commands, I handle it, otherwise I pass it to the real “port” executable. My custom functions do not currently allow me to specify arguments between “port” and the command name, but writing code to skip over any words beginning with “-“ would be possible without too much additional work, I just haven’t done it yet.



More information about the macports-users mailing list