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

New command 'alias' #2824

Closed
paulo-ferraz-oliveira opened this issue Aug 23, 2023 · 2 comments · Fixed by #2825
Closed

New command 'alias' #2824

paulo-ferraz-oliveira opened this issue Aug 23, 2023 · 2 comments · Fixed by #2825

Comments

@paulo-ferraz-oliveira
Copy link
Contributor

Pre-Check

  • did a quick search in current issues first: found nothing related
  • I'm willing or interested in helping in implementation

Environment

rebar3 3.22.1 (latest, at this moment)

Current behaviour

No such command exists.

Expected behaviour

I'd like to have a command named alias that'd output the available aliases and what they alias to, similar to zsh's alias.

@ferd
Copy link
Collaborator

ferd commented Aug 25, 2023

I'm pretty sure only the aliases in the config file are created, so just expanding the current provider to do something akin to

init(State) ->
Aliases = rebar_state:get(State, alias, []),
lists:foldl(fun({Alias, Cmds}, {ok, StateAcc}) ->
case validate_provider(Alias, Cmds, State) of
true -> init_alias(Alias, Cmds, StateAcc);
false -> {ok, State}
end
end, {ok, State}, Aliases).
but with output instead of actual initialization is all that would be required.

I guess it was never created because you can look in the config file(s) to get the same result.

Shouldn't be too complex.

@paulo-ferraz-oliveira
Copy link
Contributor Author

Thank you.

You can look in the config. but if you want something more programmatic, I guess the output should be easier to parse 😄

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 a pull request may close this issue.

2 participants