projectGenerator icon indicating copy to clipboard operation
projectGenerator copied to clipboard

Refactor/cliarguments

Open thomasgeissl opened this issue 5 years ago • 3 comments

i replaced the option parser with cxxopts, it should have the interface now on all platforms.

  • the option flags changed a bit.
    • the project path needs now the p flag instead of appending it at the end (i havent found a way to do it without a flag).
    • platforms is now -s or --platforms
  • options containing more than one word need to be wrapped in double quotes
#!/bin/sh
cd "$(dirname "$0")"
PG=./bin/projectGenerator.app/Contents/MacOS/projectGenerator 
OF=/Users/thomas.geissl/libs/of_v0.11.0_osx_release/

$PG -h
$PG --help

$PG -l -o $OF


mkdir test

$PG -o $OF -p test/first
$PG -o ../../.. -p test/second -a ofxOsc,ofOpenCv
$PG -o ../../.. -p test/second -a "ofxOsc, ofxOpenCv, ofxSvg"
$PG -o ../../.. -p test/second -a "ofxOsc, ofxOpenCv, ofxSvg" -s osx -v

$PG -o ../../.. -p test -r -d -v
PG_OF_PATH=../../.. $PG -p test/third -a "ofxOsc, ofxOpenCv, ofxSvg" -t nofmod

the version flag is still missing, but in case you wanna merge this, i think it is important to first merge my other pr #242 and tag it. then this would be already a new major release.

i only tested on osx.

let me know what you think, anything i should improve?

thomasgeissl avatar Apr 27 '20 06:04 thomasgeissl

i totally forget the frontend, will do the changes this week.

thomasgeissl avatar Apr 28 '20 06:04 thomasgeissl

turned out that the cli readme is outdated and the option parser works already the same on all platforms. https://github.com/openframeworks/projectGenerator/tree/master/commandLine

i still think it makes sense to replace it with another more intiutive option parser. https://github.com/openframeworks/projectGenerator/issues/243

thomasgeissl avatar Aug 05 '20 15:08 thomasgeissl

I think this is a good change. But we have to change the way it handle parameters right? like -o"../../.." needs a space between -o and value ?

dimitre avatar Apr 13 '23 20:04 dimitre