Giter Club home page Giter Club logo

Comments (20)

tchap avatar tchap commented on May 12, 2024

👍

from cli.

thesyncim avatar thesyncim commented on May 12, 2024

👍

from cli.

codegangsta avatar codegangsta commented on May 12, 2024

Looks like I will have to start working on this one

from cli.

smithwinston avatar smithwinston commented on May 12, 2024

+1

from cli.

oleiade avatar oleiade commented on May 12, 2024

👍

from cli.

fwl avatar fwl commented on May 12, 2024

As the 800th person who starred this, do I get a wish granted? ;-) If yes, let's please have this feature implemented. It'd be really useful and it'd complete the core functionality. Thanks!

from cli.

kytrinyx avatar kytrinyx commented on May 12, 2024

@codegangsta - if you have an idea of how you'd want to approach it, I'd be happy to take a stab at implementing it. I know you're incredibly busy with Martini.

from cli.

oleiade avatar oleiade commented on May 12, 2024

I'm ready to help with it too cc @codegangsta @kytrinyx

Katrina Owen wrote:

@codegangsta https://github.com/codegangsta - if you have an idea of
how you'd want to approach it, I'd be happy to take a stab at
implementing it. I know you're incredibly busy with Martini.


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

from cli.

codegangsta avatar codegangsta commented on May 12, 2024

Aww thanks guys. Please feel free to take a stab at it. I did start playing around with it a little while back

925a312

I believe I got hung up on help text. Let me know how far you guys get and if you get stuck. I will help out in any way I can.

❤️

from cli.

fwl avatar fwl commented on May 12, 2024

An alternative (and probably quicker/easier) way to approach this would be to offer namespacing in subcommands.

Similar to what the heroku CLI tool does, e.g.

$ heroku keys:add [KEY]

$ heroku keys:clear

Perhaps this covers most of the cases people need nested subcommands for and it may even be easier to read on the command line.

from cli.

oleiade avatar oleiade commented on May 12, 2024

I think the Heroku approach is pretty intrusive in terms of design and
implementation (Though I'm aware they're unix lovers). I think cli has
to be the more generic possible, and it implies to be the closer
possible to POSIX and unix classic command patterns.

Plus, using ':' as a separator implies a split operation which appears
to be useless to me as the golang os library already provides a ' '
splitted list of args.

fwl wrote:

An alternative (and probably quicker/easier) way to approach this
would be to offer namespacing in subcommands.

Similar to what the heroku CLI tool does, e.g.

$ heroku keys:add [KEY]

$ heroku keys:clear

Perhaps this covers most of the cases people need nested subcommands
for and it may even be easier to read on the command line.


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

from cli.

codegangsta avatar codegangsta commented on May 12, 2024

I agree with @oleiade here. Good news is that it is pretty easy already to go the namespaced route currently if you want to. I think the git style nested subcommands should definitely be in this library

from cli.

fwl avatar fwl commented on May 12, 2024

I am not advocating the Heroku approach, only added an additional idea to the discussion. 👍 for subcommands the way you both describe.

@oleiade Speaking of POSIX, I'm under the impression subcommands are out of the standard anyway (though I may be wrong): http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_02

from cli.

owenthereal avatar owenthereal commented on May 12, 2024

Any updates on this?

from cli.

AntonioMeireles avatar AntonioMeireles commented on May 12, 2024

👍

from cli.

flowchartsman avatar flowchartsman commented on May 12, 2024

I've made some progress with this issue. https://github.com/anaxagoras/cli/commit/597d5c682ca5d8c1cb63f21d733b95b4a0df27e6

There's a little redundant code that I'd like to unify, namely between helpCommand and ShowCommandHelp, and I'm currently working on getting reasonable output so that

$ ./app help cmd subcmd
NAME:
   subcmd - description

USAGE:
   command cmd [command options] [arguments...]

becomes

$ ./app help cmd subcmd
NAME:
   subcmd - description

USAGE:
   app cmd subcmd [options] [arguments...]

But I'm pretty happy with the progress so far. I'll try and get the rest of it done and add some tests sometime in the next couple of days.

from cli.

smousa avatar smousa commented on May 12, 2024

I found a way to do this using existing functionality:
https://gist.github.com/smousa/9957809

from cli.

gravis avatar gravis commented on May 12, 2024

nice!

from cli.

gravis avatar gravis commented on May 12, 2024

Isn't it done in 5a05be4 already?

from cli.

codegangsta avatar codegangsta commented on May 12, 2024

yup. closing!

from cli.

Related Issues (20)

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.