KDevelop --help: document the possibility to open files at a specific cursor position
ClosedPublic

Authored by rjvbb on Jul 3 2017, 8:30 AM.

Details

Summary

I missed a possibility to open documents (from the commandline) at a specified cursor position and it was only after looking through the code that I realised that feature was already implemented.

I thought it useful to document the feature in the --help usage info; this changeset is a proposed draft of just that.

Test Plan

N/A

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rjvbb created this revision.Jul 3 2017, 8:30 AM
apol requested changes to this revision.Jul 3 2017, 12:44 PM
apol added a subscriber: apol.

Wouldn't it be easier to write [FILE(:line)(:column)...]? It feels a bit too verbose to me.
Also since some time it supports directories that are opened as a project. This should probably be reflected too.

This revision now requires changes to proceed.Jul 3 2017, 12:44 PM
rjvbb added a comment.EditedJul 3 2017, 2:30 PM

Aleix Pol Gonzalez wrote on 20170703::12:44:35 re: "D6477: KDevelop --help: document the possibility to open files at a specific cursor position"

Wouldn't it be easier to write `[FILE(:line)(:column)...]`? It feels a bit too verbose to me.

My initial idea was [FILE[:line[:column]]...] but that felt a bit too cryptic/illegible to me in practice.
If the surrounding square brackets indicate the optional nature of FILES we should probably stick to those brackets, and not use another form with the same intention.

Also since some time it supports directories that are opened as a project. This should probably be reflected too.

i18n("Files to load, or directories to load as projects"), "[FILE[:line[:column]]...] [DIRECTORY...]" ?

kfunk added a subscriber: kfunk.Sep 20 2017, 9:15 AM
In D6477#121350, @rjvbb wrote:

Aleix Pol Gonzalez wrote on 20170703::12:44:35 re: "D6477: KDevelop --help: document the possibility to open files at a specific cursor position"

Wouldn't it be easier to write `[FILE(:line)(:column)...]`? It feels a bit too verbose to me.

My initial idea was [FILE[:line[:column]]...] but that felt a bit too cryptic/illegible to me in practice.
If the surrounding square brackets indicate the optional nature of FILES we should probably stick to those brackets, and not use another form with the same intention.

Also since some time it supports directories that are opened as a project. This should probably be reflected too.

i18n("Files to load, or directories to load as projects"), "[FILE[:line[:column]]...] [DIRECTORY...]" ?

/me just learned about http://docopt.org/ -- cool -- so what about:

i18n("Files to load, or directories to load as projects"), "[FILE[:line[:column]] | DIRECTORY]..."?

I could live with that.

Bonus points for adding two example usages at the bottom of the help text in a new Examples section(?)

In D6477#147064, @kfunk wrote:

i18n("Files to load, or directories to load as projects"), "[FILE[:line[:column]] | DIRECTORY]..."?

I could live with that.

Will do.

Bonus points for adding two example usages at the bottom of the help text in a new Examples section(?)

What help text, the one printed by kdevelop --help?

rjvbb updated this revision to Diff 20904.Oct 17 2017, 12:16 PM
kfunk accepted this revision.Oct 20 2017, 8:16 AM
In D6477#156498, @rjvbb wrote:
In D6477#147064, @kfunk wrote:

i18n("Files to load, or directories to load as projects"), "[FILE[:line[:column]] | DIRECTORY]..."?

I could live with that.

Will do.

Bonus points for adding two example usages at the bottom of the help text in a new Examples section(?)

What help text, the one printed by kdevelop --help?

Yes. But nevermind, not needed.

Please push to master branch.

rjvbb added a comment.Oct 20 2017, 8:46 AM
> What help text, the one printed by `kdevelop --help`?
Yes. But nevermind, not needed.

Good, because as far as I can see there are no hooks to do that. At least not where it makes sense to add this text (below the option list).

Please push to master branch.

Will do.

This revision was automatically updated to reflect the committed changes.