Feature - Rejected maximizer - alias max for maximize

Would anyone else think it'd be helpful to alias 'max' for 'maximize'? For some reason, even though I know it doesn't work, I sometimes type 'max hp' or 'max adv' in the CLI.
 

roippi

Developer
You can alias whatever you want at the gCLI with the "alias" command.

Code:
> alias max => maximize
 

jasonharper

Developer
Nothing is keeping you from doing alias max => maximize right now. Adding it as a built-in alias at this point would likely cause problems for people who already have a 'max' alias that expands to more than just 'maximize'.
 

xKiv

Active member
Nothing is keeping you from doing alias max => maximize

Except you shouldn't do it like that, because it will expand the first max on any cli command.

Code:
> echo max 1 initiative 1000 max

maximize 1 initiative 1000 max

> echo maximize 1 initiative 1000 max

maximize 1 initiative 1000 maximize

(obviously, the second one doesn't work - but it will break any scripts that maximize anything with "max" in it if they call maximize by any name other than max, and it will also break any ASH scripts that call maximize() with "max" in the string)

Instead, use
Code:
alias max => maximize %%

That will only expand at the beginning of a line. It's safer. It will protect you from unexpected action-at-distance.
 
Top