tibirna / qgit

Official git repository for QGit.
Other
174 stars 68 forks source link

Support --help, --help-all and --version #112

Closed hartwork closed 3 years ago

hartwork commented 3 years ago

@tibirna what do you think?

tibirna commented 3 years ago

Thank you very much for the patch. The effect ... could be more useful, inn't it? --help returns a not very helpful standard blurb, when at least the section from README.adoc about the command line parameters being passed to git logg would be useful. --version returns the content of APP_KEY from namespace_def.cpp, which nobody touched for years and I'm not sure what it meant to mean with its current value (qgit4) and the version is wrong, as I forgot for long to update it (2.9 when it should be 2.9.1).

Thanks.

hartwork commented 3 years ago

@tibirna thanks for your feedback: I agree with your findings and would be happy to improve on those matters. Let me demo alternatives, and we can continue from there.

Thank you very much for the patch. The effect ... could be more useful, inn't it? --help returns a not very helpful standard blurb, when at least the section from README.adoc about the command line parameters being passed to git logg would be useful.

Good idea, let's do that.

--version returns the content of APP_KEY from namespace_def.cpp, which nobody touched for years and I'm not sure what it meant to mean with its current value (qgit4)

Okay, I'll adjust it to say "QGit" then. If you want some other fix, please let me know.

and the version is wrong, as I forgot for long to update it (2.9 when it should be 2.9.1).

I'll do the bump as well. If you consider it out of place here, I'm happy to rebase onto any new things that appear on master.

I'll be back with an update in a hour or so.

hartwork commented 3 years ago

@tibirna alright, here's the new output:

# qgit --version
QGit 2.9.1

# qgit --help
Usage: qgit [options] [git-log-args]
QGit, a Git GUI viewer

Options:
  -h, --help     Displays help on commandline options.
  --help-all     Displays help including Qt specific options.
  -v, --version  Displays version information.

Arguments:
  git-log-args   Arguments forwarded to "git log"; for example:
                   qgit --no-merges
                   qgit v2.6.18.. include/scsi \
                                  drivers/scsi
                   qgit --since="2 weeks ago" -- kernel/
                   qgit -r --name-status release..test
                 See "man git-log" for details.

# qgit --help-all
Usage: qgit [options] [git-log-args]
QGit, a Git GUI viewer

Options:
  -h, --help                           Displays help on commandline options.
  --help-all                           Displays help including Qt specific
                                       options.
  -v, --version                        Displays version information.
  --qmljsdebugger <value>              Activates the QML/JS debugger with a
                                       specified port. The value must be of
                                       format port:1234[,block]. "block" makes
                                       the application wait for a connection.
[..]

Arguments:
  git-log-args                         Arguments forwarded to "git log"; for
                                       example:
                                         qgit --no-merges
                                         qgit v2.6.18.. include/scsi \
                                                        drivers/scsi
                                         qgit --since="2 weeks ago" -- kernel/
                                         qgit -r --name-status release..test
                                       See "man git-log" for details.

~I am unsure of adjusting APP_KEY in-place was what you had in mind.~ Happy to adjust.

tibirna commented 3 years ago

Well, given that the app uses QSettings, this change from qgit4 to QGit will make the user of any further compilations to lose their configuration (stored in $HOME/.config/qgit/qgit4.conf) because a different config file will now be sought. It's a pity applicationName is used both in the default --version and in QSettings... Perhaps better preserve the previous QSettings behaviour. So either reset qgit.cpp to what it was (and live with the confusing name), or, perhaps, if not much asked, seek a solution to change only --version and not QSettings behaviour. I'm rather puzzled over this...

Thanks again for your time and work.

hartwork commented 3 years ago

@tibirna I have reverted the "global" change to APP_KEY and am using QCoreApplication::setApplicationName("QGit");, by now. Could you do review again, please? I'm happy to adjust further as needed.

hartwork commented 3 years ago

Woohoo! :tada: