Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Commands #4

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Dynamic Commands #4

wants to merge 13 commits into from

Conversation

Dosx001
Copy link

@Dosx001 Dosx001 commented Jan 3, 2021

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.

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.
@Jintin
Copy link
Owner

Jintin commented Jan 3, 2021

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!!

@Dosx001 Dosx001 changed the title This chagne will allow aliasme.sh to run dynamic commands instead of Dynamic Commands Jan 3, 2021
@Dosx001
Copy link
Author

Dosx001 commented Jan 3, 2021

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".

@Dosx001
Copy link
Author

Dosx001 commented Jan 3, 2021

MD stands for multiple dynamic
"al dynamic" is just "vim"
image

@Dosx001
Copy link
Author

Dosx001 commented Jan 3, 2021

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.
image
With a little work, I can make a combination of both the Multiple Dynamic and Fill

@Dosx001
Copy link
Author

Dosx001 commented Jan 3, 2021

This one is pretty cool. Oh ya, I changed "Fill" to just "F" and "MF" stands for Multiple Fill.
image

@Jintin
Copy link
Owner

Jintin commented Jan 4, 2021

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.

@Dosx001
Copy link
Author

Dosx001 commented Jan 4, 2021

@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 "?".

@Dosx001
Copy link
Author

Dosx001 commented Jan 4, 2021

@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.
image

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.
image

…l is now is a combination of Fill and Dynamic
@Dosx001
Copy link
Author

Dosx001 commented Jan 5, 2021

Fills can now take as many arguments as possible like this

image

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

@Jintin Jintin self-requested a review January 19, 2021 07:57
@Dosx001 Dosx001 mentioned this pull request Jan 19, 2021
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants