I am trying to alias a command with an option. Basically, I have a command my_tool -version
which returns:
TOOL : my_tool v1.2.3.4
In a new version of the tool, my_tool
is a link to my_tool_1
, and
my_tool -version
returns:
TOOL : my_tool_1 v1.2.3.5
For backward compatibility reasons this is awful, and I would like to have an alias on the global command my_tool -version
which would achieve :
my_tool_1 -version | sed 's/my_tool_1/my_tool/'
I tried to alias the command my_tool -version
, but it does not want to handle the second argument.
Would anyone have any idea on how to achieve this ?