aliasme
aliasme copied to clipboard
Dynamic Commands
This change will allow aliasme.sh to run dynamic commands instead of just static commands. For example, when you create something like this "al add new 'cd'". Then when you run "al new root/directory" then it will change your directory to "../root/directory" or anything base on your input.
It's really cool feature that I also want to include for aliasme for a long time. Just some though to add on, can we indicate the dynamic part to place at anywhere we want of the command? Also is it possible to make support multiple dynamic part? Thanks for you contribute!!
What do you mean anywhere? Do you mean something like this "al root/directory new"?
I think for multiple dynamic parts, to keep the code simple, we could have a keyword to start a multiple dynamic command. Something like this "al multi_dynamic alias input1 input2".
MD stands for multiple dynamic
"al dynamic" is just "vim"
Ya am getting a little crazy with this. When you call WordCount the "?" is replaced by whatever put as an argument on the command line.
With a little work, I can make a combination of both the Multiple Dynamic and Fill
This one is pretty cool. Oh ya, I changed "Fill" to just "F" and "MF" stands for Multiple Fill.
What do you mean anywhere? Do you mean something like this "al root/directory new"?
I think for multiple dynamic parts, to keep the code simple, we could have a keyword to start a multiple dynamic command. Something like this "al multi_dynamic alias input1 input2".
Ya, similar to what you say, put a symbol to indicate the dynamic part. Don't know why I don't get notify about the following chat, you can pin my id next time.
@Jintin """Some suggest on the dynamic or multi-fill part. Is is possible to put some indicator like $1 $2 indicate multiple usage? or $0 for list type of data? example: mv $1.md $1.txt vim $0"""
I did use $1, $2, etc before. But you would need to backlash it when adding a new alias. Something like this "al add new '\$1 \$2 \$3' FM". I didn't like having to type an extra character so I changed "$" to "?".
@Jintin Check out these new changes!!! This pull request just keeping getting crazier lol.
First off, the biggest change is now Fills and Multi Fills are now the same thing just Fills. While the new Multi Fills is now a combination of Fill and Dynamic.
Here is a visual example.
When you “al ls”, you’ll see that Multi Fills have a number next to them, this number is the amount of arguments needed to run the alias command. In order to add a Multi Fill alias you need to do something like this “al add VP ‘vim ?1 ?2 ?3 ?4 -p’ MF 4”. Then just run like this “al VP a.py b.py c.py d.py”
You can also have something like this.
Fills can now take as many arguments as possible like this
I also changed how you declare the cmdType when adding a new alias. I kept typing "FM" instead of "MF", so this change will greatly help me lol, and overall less typing. D -> d F -> f MF -> m