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

Allow REPL command aliasing #769

Merged
merged 4 commits into from Dec 21, 2014
Merged

Conversation

filipw
Copy link
Member

@filipw filipw commented Jun 18, 2014

Fixes #730

You can now do:
:alias "install" "i"

In this case the new command is :i and you can use it as you would :install. Aliasing is implemented as another REPL command too.

This can obviously wait for the merge until the DEV branch accepts PRs again.

@adamralph adamralph added the hold label Jun 18, 2014
@adamralph
Copy link
Contributor

👍 nice one!

I think when I raised the issue I had in mind not only an alias command but also some kind of persistent aliasing. Unfortunately I didn't write out details 😒. I guess such a thing would have to live somewhere like .opts or app.config.

@glennblock
Copy link
Contributor

Let's hold this for post 0.10

On Wed, Jun 18, 2014 at 2:35 PM, Adam Ralph notifications@github.com
wrote:

[image: 👍] nice one!

I think when I raised the issue I had in mind not only an alias command
but also some kind of persistent aliasing. Unfortunately I didn't write out
details [image: 😒]. I guess such a thing would have to live
somewhere like .opts or app.config.


Reply to this email directly or view it on GitHub
#769 (comment).

@ryanrousseau
Copy link
Contributor

👍

@adamralph persistent aliasing would be a good use case for a global opts file

@filipw
Copy link
Member Author

filipw commented Aug 22, 2014

can anyone look at that now?

@adamralph adamralph self-assigned this Dec 11, 2014
@@ -28,14 +28,14 @@ public class Repl : ScriptExecutor
_scriptArgs = scriptArgs;
_serializer = serializer;
Console = console;
Commands = replCommands != null ? replCommands.ToList() : new List<IReplCommand>();
Commands = replCommands != null && replCommands.Any(x => x.CommandName != null) ? replCommands.Where(x => x.CommandName != null).ToDictionary(x => x.CommandName, x => x) : new Dictionary<string, IReplCommand>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&& replCommands.Any(x => x.CommandName != null) is made redundant by the Where()

@adamralph
Copy link
Contributor

@filipw any opinion on my comment above regarding replInstance.Commands.Add()? Apart from that one concern I think this PR is ready to go.

@filipw
Copy link
Member Author

filipw commented Dec 15, 2014

sorry I somehow missed it. yeah indexer is a better idea

@adamralph adamralph assigned filipw and unassigned adamralph Dec 17, 2014
@adamralph
Copy link
Contributor

@filipw please assign back to me after that change has been added

@filipw
Copy link
Member Author

filipw commented Dec 20, 2014

done

@filipw filipw assigned adamralph and unassigned filipw Dec 20, 2014
@adamralph
Copy link
Contributor

👌

adamralph added a commit that referenced this pull request Dec 21, 2014
@adamralph adamralph merged commit a12a281 into scriptcs:dev Dec 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow REPL commands to be aliased
4 participants