GithubHelp home page GithubHelp logo

Args parsing about openrhythm HOT 24 CLOSED

openrhythm avatar openrhythm commented on May 28, 2024
Args parsing

from openrhythm.

Comments (24)

mdsitton avatar mdsitton commented on May 28, 2024

Yeah i have been looking at various options for this for a little while now but never really got to comparing the different options very well.

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

Well i searched the different existing libs and this one seems the easies to use !

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

You can define " hard-coded" args in an array, plus parse manually other args

from openrhythm.

mdsitton avatar mdsitton commented on May 28, 2024

Honestly I don't like the syntax of any of the major options out there.
The syntax of this parser is pretty cool though:
https://github.com/aardvarkk/argh

from openrhythm.

mdsitton avatar mdsitton commented on May 28, 2024

If we have to I don't mind just implementing my own lol. They aren't very complex to do honestly. I could also just fork that one and throw it into our codebase and clean it up a bit. :P

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

Sure, I wanted to write my own lib too, and also for configuration files. But hell, there are so many good libs out there ^^

from openrhythm.

mdsitton avatar mdsitton commented on May 28, 2024

Well for config files i was wanting to use json or YAML.

from openrhythm.

mdsitton avatar mdsitton commented on May 28, 2024

We should probably make another issue about config files

from openrhythm.

mdsitton avatar mdsitton commented on May 28, 2024

ok issue #15 is for config files and the config system

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

Great !

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

I checked out Argh, seems cool, the syntax is pretty clear. But there are some problems :

  • no apparent support for "bad args"
  • only "dynamic" args definitions, can't use a header to define the args (header parsed for the html doc :p )

from openrhythm.

mdsitton avatar mdsitton commented on May 28, 2024

I dont really want to use Argh because its not really a well used library, and if thats the case i'd just rather do something ourselfs. But I mainly just mentioned it as a example of some nicer looking syntax :P

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

Hmm on the other hand OptionParser let us do a lot of job. I have to parse myself the integer args… :p

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

To be fair I think I'm gonna rewrite optionparser x)

from openrhythm.

mdsitton avatar mdsitton commented on May 28, 2024

One thing though what did you mean by "bad args"?

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

Well there are two things : "non-options" (things not preceded by -- or --option ) such as filenames for gcc, and unknown options. Argh does not seem to support "out of the box" neither of them… And it does not support parameters for short options.
Anyway, i've almost finished to rewrite OptionParser.

from openrhythm.

mdsitton avatar mdsitton commented on May 28, 2024

@Salamandar So how is this going, you said you were going to write your own parser(or rewrite the other one)

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

Well it's going fine, I just had a really big existential issue about if it was relevant or not ^^

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

Finally OptionParser is just too overkill. TCLAP is pretty good (I just wrote a PR to TCLAP and may write a second to support multiple one-char flags for an option).
The work in the commandline branch is just a draft because I'm working on my laptop this week :p

from openrhythm.

mdsitton avatar mdsitton commented on May 28, 2024

My problem with TCLAP is that it is largely unmaintained. Last release was 2011, last commits were 2015, and the page even says that it will likely not be developed any further.

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

Yeah that was my issue too. But some widely libs are unmaintained too. TCLAP does not seem buggy, and the authors seem quick to answer on sourceforge even if it's "i don't have much time but please make a patch !"

from openrhythm.

mdsitton avatar mdsitton commented on May 28, 2024

I still don't mind rolling our own

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

Well I think I'm gonna fork TCLAP on Github (and tell the original authors about it) so we can restart dev on it.

from openrhythm.

Salamandar avatar Salamandar commented on May 28, 2024

Finished with PR #32. Closing, we'll solve the possible problems in the PR.

from openrhythm.

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.