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

Aliasme 4.0.0 Dynamic Commands Edition #5

Closed
wants to merge 9 commits into from

Conversation

Dosx001
Copy link

@Dosx001 Dosx001 commented Jan 4, 2021

EDIT: I only made this branch because of the bugs but now everything seems fine. I am going to go back to working on my master branch now.

If you haven't checked out my other pull request updates you should look at that first.

First off this version is amazing! lol However the autocomplete is broken :(

One major change is the format of the cmd file in "~/.aliasme". The first two lines in cmd are still the same as before. The name of the alias and then the command itself. However, on the third and every line divisible by 3 is now the "cmdType" for each alias. There are 4 cmd types Default, Dynamic, Fill, and Multi Fill.

There were a few functions that were modified to accommodate the change in the format of the cmd file.

The best part about this version is that you now have access to dynamic commands and you don't need keywords like D, Fill, MF, etc to use them. You assign a cmdType when adding a new alias. For example, "al add convert MF 'mv ?.md ?.txt'". "convert" is now a Multi Fill command. To call it use "al convert filename" and it changes a file from .md to .txt.

Here's is a visual example.
image

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.
… alias where

you can change its' contents per call
functions were modify to accommodate for cmdType. However autocomplete is broken.
@Dosx001
Copy link
Author

Dosx001 commented Jan 4, 2021

Careful remove() is also buggy.

@Dosx001
Copy link
Author

Dosx001 commented Jan 4, 2021

I thought _autocomplete() was responsible for the autocomplete on the command line... This bug fix was true pain.

@Jintin
Copy link
Owner

Jintin commented Jan 4, 2021

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

so aliasme can know if one command is legal or not and give some warning .

@Dosx001 Dosx001 closed this Jan 15, 2021
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.

None yet

2 participants