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

Rename App::Spec::Completion::Bash to ...::bash #9

Open
dolmen opened this issue Dec 11, 2015 · 4 comments
Open

Rename App::Spec::Completion::Bash to ...::bash #9

dolmen opened this issue Dec 11, 2015 · 4 comments

Comments

@dolmen
Copy link

dolmen commented Dec 11, 2015

Rename App::Spec::Completion::Bash to App::Spec::Completion::bash and App::Spec::Completion::Zsh to App::Spec::Completion::zsh.
That will allow extension and simplify App::Spec::generate_completion:

sub generate_completion {
    my ($self, %args) = @_;
    my $shell = delete $args{shell};

    require "App/Spec/Completion/$shell.pm";
    "App::Spec::Completion::$shell"->new({ spec => $self })->generate_completion(%args)
}
@dolmen
Copy link
Author

dolmen commented Dec 11, 2015

As a side note, this is the approach I'm using in my Angel's Prompt project that has shell-specific features.

@dolmen
Copy link
Author

dolmen commented Dec 11, 2015

This approach also allows the startup of the program to be faster as the shell plugin will only be loaded when used (the use App::Spec::Completion::* at the beginning of App::Spec must be removed as they are replaced by the require).

@perlpunk
Copy link
Owner

Thanks, I'm planning some renaming (and lazy loading) anyway, so that it easier to have plugins.
I thought about App::Spec::Generator::Completion::*

angel-PS1 looks interesting =)

@perlpunk
Copy link
Owner

I would actually like to move the completion and pod generator to App::AppSpec, so that App::Spec(::Run) is the only thing you need to install for running the app.

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

No branches or pull requests

2 participants