Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/cliarguments #245

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

thomasgeissl
Copy link
Contributor

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
Copy link
Contributor Author

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

@thomasgeissl
Copy link
Contributor Author

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.
#243

@dimitre
Copy link
Member

dimitre commented Apr 13, 2023

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants