D7216: refactor kpackagetool away from stringy options

2017-09-01 Thread Harald Sitter
This revision was automatically updated to reflect the committed changes.
Closed by commit R290:9597930a4596: refactor kpackagetool away from stringy 
options (authored by sitter).

REPOSITORY
  R290 KPackage

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D7216?vs=17926&id=19045

REVISION DETAIL
  https://phabricator.kde.org/D7216

AFFECTED FILES
  src/kpackagetool/kpackagetool.cpp
  src/kpackagetool/main.cpp
  src/kpackagetool/options.h

To: sitter, sebas, apol
Cc: #frameworks


D7216: refactor kpackagetool away from stringy options

2017-09-01 Thread Aleix Pol Gonzalez
apol accepted this revision.
apol added a comment.
This revision is now accepted and ready to land.


  Won't hurt, benefits from some compiler checking so it's better.

REPOSITORY
  R290 KPackage

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D7216

To: sitter, sebas, apol
Cc: #frameworks


D7216: refactor kpackagetool away from stringy options

2017-08-09 Thread Aleix Pol Gonzalez
apol added a comment.


  if that makes you happy, it makes me happy.
  +1

REPOSITORY
  R290 KPackage

REVISION DETAIL
  https://phabricator.kde.org/D7216

To: sitter, sebas, apol
Cc: #frameworks


D7216: refactor kpackagetool away from stringy options

2017-08-09 Thread Harald Sitter
sitter created this revision.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.

REVISION SUMMARY
  A notable advantage of qcommandlineoption is that using the objects the
  compiler makes sure that everyone is talking about the same option.
  Previously kpackagetool would create the option objects in main but then
  not use them to grab values out of the commandlineparser, instead relying
  on the stringy representation of the option. This is a tad harder to
  read but more importantly, it bypasses the compiler opening the code up for
  typos. Namely one could do `d->parser->value("hahs")` while doing
  `d->parser->value(Options::hahs)` will result in a build failure.
  
  To preven this, refactor the entire option handling to use static option
  instances from a new Options namespace as to let the compiler help us not
  write typos.
  
  In the future option handling could be additionally changed to parse all
  options at once early on and construct an option struct or something to
  reduce code clutter from calling isSet a million times.

TEST PLAN
  - all existing tests pass
  - `--help` still looks correct

REPOSITORY
  R290 KPackage

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D7216

AFFECTED FILES
  src/kpackagetool/kpackagetool.cpp
  src/kpackagetool/main.cpp
  src/kpackagetool/options.h

To: sitter, sebas, apol
Cc: #frameworks