Giter Club home page Giter Club logo

Comments (4)

fenekku avatar fenekku commented on July 17, 2024

Hey, thanks for this interesting observation. It might be possible.

Right now commandeer relies on parseopt2 to do the initial command line parsing. Great, we don't have to worry about extracting the command line arguments ourself AND developers (and by consequence users) already familiar with parseopt2's behaviour know what to expect and can port their manual usage of parseopt2 over to commandeer! If we are to achieve space separated options, we would have to add a layer of accounting on parseopt2 to keep track of argument/option order. It is something I have thought a bit about but would need to investigate more.

I am going to keep this open like #5 because they are along the same lines even though I don't have anything in the short term yet.

from commandeer.

moigagoo avatar moigagoo commented on July 17, 2024

developers (and by consequence users) already familiar with parseopt2's behaviour know what to expect

The problem is that people are familiar with CLIs, not the tools to build CLIs :-) And it's quite common to separate options and their values with a space.

Maybe the right thing to do is to add this feature to parseopt2. What do you think?

from commandeer.

fenekku avatar fenekku commented on July 17, 2024

add this feature to parseopt2

That would be an interesting thing to do! Getting consensus on a larger user base like parseopt2 / the nim ecosystem may be harder though ;)

from commandeer.

fenekku avatar fenekku commented on July 17, 2024

Hello! I just merged #16 that addresses this:

commandline:
  argument path, string
  option target, char, "target", "t"

# called with myapp -t t path
echo "path ", path  # path
echo "target ", target  # t

I didn't go the parseopt2 avenue for the stated reasons and also because I suspect parseopt2's current implementation makes it more flexible for another library to work a top of.

In any case I am closing this. Cheers!

from commandeer.

Related Issues (11)

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.