Replies: 5 comments 2 replies
-
Hi @muellerto!
This is not how you add an alias. Rather, open the config file and, in the alias Tr='c:/path/executable' Parameters passed to the alias name will be passed to the aliased command. EDIT: Haven't tried, but |
Beta Was this translation helpful? Give feedback.
-
My initial post had several inadequacies. I fixed this there. Indeed I always had three aliases in my clifmrc and the executable I use has no explicit path at all, it's in the search path. Currently my aliases use a one liner shell script:
With this I can indeed specify a parameter on the command line:
The invocation expands the alias, expands the parameter and calls then the script with that parameter. But I need a different script for every single alias. |
Beta Was this translation helpful? Give feedback.
-
Could you expand on this? What is exactly the problem? What are you trying to achieve and why do you need different scripts? |
Beta Was this translation helpful? Give feedback.
-
The question is: can I configure an alias which is based directly on an executable which gets parameter values from the command line before execution? The alias is surely not a problem:
But can this be called with ELNs as ...
... so that this results in an expanded command line like ...
Or can I have a selection ...
... and then call it with the selection like ...
... so that I get a resulting command line like ...
In my case the word However, when I configure the alias to use a small shell script it's different. The script gets the parameters always very well, it receives also an expanded Is there a difference in the parameter handling and expansion and the handling of |
Beta Was this translation helpful? Give feedback.
-
Yes, you can have an executable (including shell scripts) plus option parameters in an alias and then enter the alias plus whatever you like, including file names and the
As far as I know, the only way for I'll take a look at it however. What is the name of this executable? I'll try to reproduce this. EDIT: Tried with three different aliases, one for an internal command, another one for an external command, and a third one for a script: alias a_int='p'
alias a_ext='stat -t'
alias a_script='~/script.sh' Then I executed the three aliases passing to them the a_int sel 1-3 b:mybm
a_ext sel 1-3 b:mybm
a_script sel 1-3 b:mybm Everything works as expected, provided the expansion can be made. If not (e.g. no selected files, no ELN 3, or no bookmark named |
Beta Was this translation helpful? Give feedback.
-
On Windows you have the problem that some applications are based on a so called Explorer integration. The effect is that these applications make important entries in the context menu of the Explorer which do then not call Explorer functionality but application functionality based upon the Explorer's selection. This saves them a lot of GUI stuff, the big disadvantage of that is that these applications make themselves dependent from the Explorer.
Prominent examples are TortoiseSvn and TortoiseGit which are a SVN/Git clients both based on Explorer integration. But indeed there's just an executable binary and the Explorer integration does nothing else than calling this binary again and again with a concrete set of parameters. No witchcraft at all. Works good outside the Explorer if you know what you do.
I configured this satisfactory using small shell script files, that's simple. But I tried to configure this also using aliases to have all in a few lines on the same place, having the principle in mind to select some files and then run an alias on
sel
to call such a TortoiseSvn action, or on some ELNs or on.
which is also often needed.So I tried to use
sel
in the alias:Not good.
sel
seems not to be expanded and remains an unknown path for the called executable. So I tried to let the parameter list open in the alias in the hope that the defined alias and any given parameters from the command line are expanded and then glued together before execution:Does also not work. The alias is called without parameters. What I really would like is to specify numbered parameters in the alias:
Or with ELNs:
Also
sel
should work in this case:An implementation could be to call just
sh
with the expanded alias as a script and when the script contains numbered parameterssh
is responsible to evaluate them.Beta Was this translation helpful? Give feedback.
All reactions