Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: unqualified
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: PC
    • External issue ID:
      45971

      Description

      The following problems are associated with the command line interface (CLI) to Fop:

      1. Running 'fop' with no arguments throws an exception after printing
      a usage statement.

      2. Running 'fop -v' throws an exception after printing the version.

      3. Current usage and help messages refer to 'Fop' while the user
      executes 'fop'.

      The attached patch was generated by running 'svn diff' at the top of
      the working directory of a checked-out fop trunk at revision 702651.

      It affects the following files:

      src/java/org/apache/fop/cli/CommandLineOptions.java
      src/java/org/apache/fop/cli/Main.java

      It corrects all three issues listed above.

      1. fop.patch
        5 kB
        Tom Browder

        Activity

        Hide
        Tom Browder added a comment -

        Attachment fop.patch has been added with description: Patch to correct the bugs.

        Show
        Tom Browder added a comment - Attachment fop.patch has been added with description: Patch to correct the bugs.
        Hide
        Vincent Hennebert added a comment -

        Hi Tom,

        Good thing you created a bug report for this, it was being forgotten. Patch applied in revision 704008 (http://svn.apache.org/viewvc?view=rev&revision=704008). The following modifications were made:

        • minor style fixes (illegal tab characters)
        • System.exit is called at only two places: with a return value of 1 when an unknown argument is given; with a return value of 0 in all other cases. The rationale is that it's not erroneous to simply run fop without argument, or with -v or -h.
        • the help message is accordingly sent to either stderr or stdout

        The semantic of the boolean return value has been changed: false now indicates that processing should stop normally, not because of an error (there are exceptions for that).

        Ideally this whole part of the code should be re-worked to make use of a common command-line parsing library (Apache Commons CLI), but this patch is a reasonable trade-off.

        Please re-open the bug if you're not happy with the modifications made.
        Thanks Tom!
        Vincent

        Show
        Vincent Hennebert added a comment - Hi Tom, Good thing you created a bug report for this, it was being forgotten. Patch applied in revision 704008 ( http://svn.apache.org/viewvc?view=rev&revision=704008 ). The following modifications were made: minor style fixes (illegal tab characters) System.exit is called at only two places: with a return value of 1 when an unknown argument is given; with a return value of 0 in all other cases. The rationale is that it's not erroneous to simply run fop without argument, or with -v or -h. the help message is accordingly sent to either stderr or stdout The semantic of the boolean return value has been changed: false now indicates that processing should stop normally, not because of an error (there are exceptions for that). Ideally this whole part of the code should be re-worked to make use of a common command-line parsing library (Apache Commons CLI), but this patch is a reasonable trade-off. Please re-open the bug if you're not happy with the modifications made. Thanks Tom! Vincent
        Hide
        Tom Browder added a comment -

        Patch looks good, Vincent. Thanks!

        -Tom

        Show
        Tom Browder added a comment - Patch looks good, Vincent. Thanks! -Tom
        Hide
        Tom Browder added a comment -

        (In reply to comment #2)
        > Patch looks good, Vincent. Thanks!
        >
        > -Tom

        Vincent, I was disappointed not to see this fix mentioned in the change list for the 1.0 release. I know it's not major, but it did change the CLI response to fop.

        Show
        Tom Browder added a comment - (In reply to comment #2) > Patch looks good, Vincent. Thanks! > > -Tom Vincent, I was disappointed not to see this fix mentioned in the change list for the 1.0 release. I know it's not major, but it did change the CLI response to fop.
        Hide
        Vincent Hennebert added a comment -

        (In reply to comment #3)
        > (In reply to comment #2)
        > > Patch looks good, Vincent. Thanks!
        > >
        > > -Tom
        >
        > Vincent, I was disappointed not to see this fix mentioned in the change list
        > for the 1.0 release. I know it's not major, but it did change the CLI response
        > to fop.

        Hi Tom,

        When we commit changes we usually add an entry to the status.xml file at the root of the project. The changes are then reflected on the website:
        http://xmlgraphics.apache.org/fop/1.0/changes_1.0.html

        I don't remember back then if I just forgot to add an entry relating to this issue, or if I judged that that was too small a change to warrant a log. I've now added one:
        http://svn.apache.org/viewvc?view=revision&revision=1032549

        It will appear on the website soon. A bit late I admit but that may help other users. Was that what you were looking for?

        Regards,
        Vincent

        Show
        Vincent Hennebert added a comment - (In reply to comment #3) > (In reply to comment #2) > > Patch looks good, Vincent. Thanks! > > > > -Tom > > Vincent, I was disappointed not to see this fix mentioned in the change list > for the 1.0 release. I know it's not major, but it did change the CLI response > to fop. Hi Tom, When we commit changes we usually add an entry to the status.xml file at the root of the project. The changes are then reflected on the website: http://xmlgraphics.apache.org/fop/1.0/changes_1.0.html I don't remember back then if I just forgot to add an entry relating to this issue, or if I judged that that was too small a change to warrant a log. I've now added one: http://svn.apache.org/viewvc?view=revision&revision=1032549 It will appear on the website soon. A bit late I admit but that may help other users. Was that what you were looking for? Regards, Vincent
        Hide
        Glenn Adams added a comment -

        batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

        Show
        Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

          People

          • Assignee:
            fop-dev
            Reporter:
            Tom Browder
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development