Code Monkey home page Code Monkey logo

app-spec-p5's People

Contributors

eitanschuler avatar manwar avatar perlpunk avatar s-nez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

app-spec-p5's Issues

It could use more of Moo

Looking at the source code, I notice that in a few places you're not exploiting the facilities that Moo provides (e.g. you've got common and build do more-or-less what BUILDARGS and BUILD are designed to do, you handle lazy attributes by hand, you have no type constraints).
Is there a particular reason for that, or is just general unfamiliarity with Moo?
Would it be appreciated if I sent a pull request making the whole thing more Moo-ish? I'd also like to add some type constraints via Type::Tiny, but that can come later.

Why YAML?

I don't see the need for YAML.
It would be much simpler to write the spec in Perl.

If you had the need to parse the spec from outside the program itself (ex for documentation generators), you could just inject an --export-getopt-spec option that would dump the spec.

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

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)
}

Maybe regression: the 'class' slot of the spec is now required

Before 0.005, it was possible to ignore the class slot of the spec, as long as a pre-built object was set in App::Spec::Run::cmd.
Now, op method names are assumed to be fully-qualified, and if not, they're prefixed with the class. I'm not sure why this is.

Regression: op must now be a string

Before 0.005, a command op could be a coderef, which was nice for those times where you just need to call an existing method with a value from the runner, see https://www.thenautilus.net/cgit/Sietima/tree/lib/Sietima/Role/SubscriberOnly/Moderate.pm?h=v1.0.4-dzilla&id=402b4b8e83babbb453c3caa23fb7e75c0cfbe1c0#n221for example.

With 0.005, I had to add methods just for App::Spec, see
https://www.thenautilus.net/cgit/Sietima/commit/?id=db2394b8c0beba5f4323dffe2d20adad1c5acf2b

Generate man page(s)

Generating a man pages (or several per subcommand) from your spec with the complete usage and descriptions.

Generate POD

Generating a pod file from your spec with the complete usage and descriptions.

Implement global parameters

Right now only parameters for apps with subcommands are possible, and for nested subcommands only for the last subcommand.

Todo:

myapp param [options]
myapp param0 cmd1 param1 cmd2 param2 [options]
  • Implement in App::Spec::Run
  • Pod
  • Usage
  • zsh completion
  • bash completion

Howto install?

I don't know how to install this great module, I love the ideas implemented here!

In fact I have the feeling there is nothing like 'perl Makefile.PL; make; make install'. Is the idea for development-time simply to copy lib/App to my current directory und do this:

use lib './lib';
use App::Spec;
...
I wish it would be more fun if I could do it the perl-standard way:

git clone https://github.com/perlpunk/App-Spec-p5.git
cd App-Spec-p5
perl Makefile.PL
make
make install

Thanks for your understanding.
Richard

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.