After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 620684 - switch commandline parsing to hyena
switch commandline parsing to hyena
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: General
WISHLIST
Other Linux
: Normal normal
: 0.7.0
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-05 20:28 UTC by Paul Lange
Modified: 2010-06-08 17:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[1/1] Port command line parsing to Hyena.CommandLine (11.59 KB, patch)
2010-06-06 21:12 UTC, Paul Lange
needs-work Details | Review
update patch (12.54 KB, patch)
2010-06-07 19:50 UTC, Paul Lange
reviewed Details | Review
Port commandline options parsing to Hyena.CommandLine library. (12.63 KB, patch)
2010-06-08 11:26 UTC, Paul Lange
none Details | Review
Port commandline options parsing to Hyena.CommandLine library. (13.39 KB, patch)
2010-06-08 16:06 UTC, Paul Lange
committed Details | Review

Description Paul Lange 2010-06-05 20:28:40 UTC
I want to port F-spots command line handling to Hyena.

While working on this I found out that Hyena.CommandLine only supports options that are marked with "--". F-spot currently has many "-" options, so this would mean some kind of break of functionality.

I think this is acceptable but would like to hear more opinions.
Comment 1 Paul Lange 2010-06-06 21:12:18 UTC
Created attachment 162888 [details] [review]
[1/1] Port command line parsing to Hyena.CommandLine

 src/main.cs |  272 +++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 151 insertions(+), 121 deletions(-)
Comment 2 Paul Lange 2010-06-06 21:16:09 UTC
Two questions: should we update copyright and add a license header?
Comment 3 Ruben Vermeersch 2010-06-07 09:40:17 UTC
Don't bother with copyrights and license stuff, I am relicensing F-Spot and will then do it all in one go. Will look into your patch very soon, but from a first glance it looks good.
Comment 4 Ruben Vermeersch 2010-06-07 13:17:33 UTC
Hi Paul, I'm looking at your patch but it seems to be a plain git diff and I'm getting some conflicts.

Could you:

 * git commit all your changes
 * then do: git pull --rebase
 * (if needed fix any conflicts, git add the conflicting files and git rebase --continue)
 * git format-patch

And attach the resulting patch?

That way it'll work and the patch will have a good commit message + authorship information.
Comment 5 Paul Lange 2010-06-07 19:50:38 UTC
Created attachment 162965 [details] [review]
update patch

now using git format-patch.
Comment 6 Ruben Vermeersch 2010-06-08 09:59:31 UTC
Review of attachment 162965 [details] [review]:

Clean patch (with two comments, see below). We should also update the launcher script (src/f-spot.in) to provide backwards compatibility with the short options (-h, -?, -b, -p, -i, -v, -V). No new short options will be accepted in the future.

Once those are fixed, it can go in for me.

::: src/main.cs
@@ -81,5 +108,5 @@
-			for (int i = 0; i < args.Length && !shutdown; i++) {
-				switch (args [i]) {
-				case "-h": case "-?": case "-help": case "--help": case "-usage":
... 2 more ...
+			
+			if (ApplicationContext.CommandLine.ContainsStart ("help")) {
+				ShowHelp ();
... 2 more ...

F-Spot should probably exit after showing the help message.

@@ +112,3 @@
+			
+			if (ApplicationContext.CommandLine.Contains ("version")) {
+				ShowVersion ();

Same thing with version information.
Comment 7 Paul Lange 2010-06-08 11:26:06 UTC
Created attachment 163043 [details] [review]
Port commandline options parsing to Hyena.CommandLine library.
Comment 8 Paul Lange 2010-06-08 11:27:05 UTC
updated patch. I didn't find anything in f-spot.in to update.

thanks for review.
Comment 9 Ruben Vermeersch 2010-06-08 11:30:43 UTC
Please mark the old version as obsolete when submitting the new patch.
Comment 10 Paul Lange 2010-06-08 16:06:27 UTC
Created attachment 163076 [details] [review]
Port commandline options parsing to Hyena.CommandLine library.
Comment 11 Ruben Vermeersch 2010-06-08 17:08:00 UTC
Attachment 163076 [details] pushed as cd79bfe - Port commandline options parsing to Hyena.CommandLine library.


Fixed, with small additions. Thanks a lot! This turned out to be more complex
than I expected, nice work!