pcorelist - a corelist wrapper with shell completion (App::Spec)

Maybe you've read my recent post about App::Spec.

As an example, I've written a wrapper around the corelist tool, which adds shell completion.

Since the options of the original tool weren't ideal for completion, I added subcommands.

Perl Versions, features and modules are completable.

The script is in part a wrapper around corelist, and partly I stole code from it.

I attached a little gif animation which shows the script in action:

pcorelist-zsh.gif

This is zsh. You see the parameter name which you are about to complete, and for long lists you can navigate with your arrow keys through the options. Also zsh reuses the space for completion.

In bash this would look a bit more noisy, especially with the long lists, so I chose zsh ;-)

Getting the completion to work:

  • Zsh:
    Put this in your .zshrc before the compinit stuff:
    fpath=('/path/to/App-Spec-p5/examples/zsh' $fpath)
    Then exec zsh
  • Bash:
    $ source examples/bash/pcorelist.bash


You can also comment on reddit.com

Leave a comment

About tinita

user-pic just another perl punk,