Merge lp:~asc/fluidity/usageerrorfix into lp:fluidity

Proposed by Adam Candy
Status: Merged
Merge reported by: Adam Candy
Merged at revision: not available
Proposed branch: lp:~asc/fluidity/usageerrorfix
Merge into: lp:fluidity
Diff against target: 12 lines (+1/-1)
1 file modified
main/Usage.cpp (+1/-1)
To merge this branch: bzr merge lp:~asc/fluidity/usageerrorfix
Reviewer Review Type Date Requested Status
Fluidity Core Team Pending
Review via email: mp+90099@code.launchpad.net

Description of the change

This addresses bug lp:919315, such that a version check and help call to Fluidity does not complete with a non-zero error.

Trunk fluidity:
# ./trunk/bin/fluidity -V; echo $?
...
255
# ./trunk/bin/fluidity -h; echo $?
...
255

This branch fluidity:
# ./trunk/bin/fluidity -V; echo $?
...
0
# ./trunk/bin/fluidity -h; echo $?
...
0

To post a comment you must log in.
Revision history for this message
Adam Candy (asc) wrote :

Is this enough of a fix? The conversation at the Dev meeting eluded to the possibly of complications?

Note the output is still to stderr.

lp:~asc/fluidity/usageerrorfix updated
3903. By Gerard

Should return 0 rather than non-zero when the -V option is specified.

Revision history for this message
Adam Candy (asc) wrote :

Oddly my local version shows a different diff:
=== modified file 'main/Usage.cpp'
--- main/Usage.cpp 2011-10-28 04:52:07 +0000
+++ main/Usage.cpp 2012-01-25 12:29:34 +0000
@@ -273,13 +273,13 @@
   // Help?
   if(fl_command_line_options.count("help")){
     usage(argv[0]);
- exit(-1);
+ exit(0);
   }

   // Version?
   if(fl_command_line_options.count("version")){
     print_version();
- exit(-1);
+ exit(0);
   }

   // Verbose?

Both these line changes should be in the branch - I'm hoping Launchpad has made an error in the diff...

Revision history for this message
Stephan Kramer (s-kramer) wrote :

That's because Gerard's already committed half of your fix to the trunk in the mean time.

Revision history for this message
Adam Candy (asc) wrote :

I realised this on the walk back up to my desk. Thanks. That'll teach me to fix something that isn't assigned to me.

Still, I'll finish it off and merge this half in. Fluidity shouldn't error on a help request.

lp:~asc/fluidity/usageerrorfix updated
3904. By Adam Candy

A help call to Fluidity also does not now complete with a non-zero error.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'main/Usage.cpp'
2--- main/Usage.cpp 2012-01-25 12:48:16 +0000
3+++ main/Usage.cpp 2012-01-25 12:50:30 +0000
4@@ -273,7 +273,7 @@
5 // Help?
6 if(fl_command_line_options.count("help")){
7 usage(argv[0]);
8- exit(-1);
9+ exit(0);
10 }
11
12 // Version?