Fop
  1. Fop
  2. FOP-1988

FOP crash on version switch (-v)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 0.95
    • Fix Version/s: None
    • Component/s: general
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: PC
    • External issue ID:
      52144

      Description

      It appears '-v' should be accepted.....

      $ fop -v
      FOP Version 0.95

      USAGE
      Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>
      [OPTIONS]
      -d debug mode
      -x dump configuration settings
      -q quiet mode
      -c cfg.xml use additional configuration file cfg.xml
      -l lang the language to use for user information
      -r relaxed/less strict validation (where available)
      -dpi xxx target resolution in dots per inch (dpi) where xxx is a number
      -s for area tree XML, down to block areas only
      -v to show FOP version being used

      -o [password] PDF file will be encrypted with option owner password
      -u [password] PDF file will be encrypted with option user password
      -noprint PDF file will be encrypted without printing permission
      -nocopy PDF file will be encrypted without copy content permission
      -noedit PDF file will be encrypted without edit content permission
      -noannotations PDF file will be encrypted without edit annotation permission
      -pdfprofile prof PDF file will be generated with the specified profile
      (Examples for prof: PDF/A-1b or PDF/X-3:2003)

      [INPUT]
      infile xsl:fo input file (the same as the next)
      -fo infile xsl:fo input file
      -xml infile xml input file, must be used together with -xsl
      -atin infile area tree input file
      -imagein infile image input file
      -xsl stylesheet xslt stylesheet

      -param name value <value> to use for parameter <name> in xslt stylesheet
      (repeat '-param name value' for each parameter)

      [OUTPUT]
      outfile input will be rendered as PDF into outfile
      -pdf outfile input will be rendered as PDF (outfile req'd)
      -pdfa1b outfile input will be rendered as PDF/A-1b compliant PDF
      (outfile req'd, same as "-pdf outfile -pdfprofile PDF/A-1b")
      -awt input will be displayed on screen
      -rtf outfile input will be rendered as RTF (outfile req'd)
      -pcl outfile input will be rendered as PCL (outfile req'd)
      -ps outfile input will be rendered as PostScript (outfile req'd)
      -afp outfile input will be rendered as AFP (outfile req'd)
      -tiff outfile input will be rendered as TIFF (outfile req'd)
      -png outfile input will be rendered as PNG (outfile req'd)
      -txt outfile input will be rendered as plain text (outfile req'd)
      -at [mime] out representation of area tree as XML (outfile req'd)
      specify optional mime output to allow AT to be converted
      to final format later
      -print input file will be rendered and sent to the printer
      see options with "-print help"
      -out mime outfile input will be rendered using the given MIME type
      (outfile req'd) Example: "-out application/pdf D:\out.pdf"
      (Tip: "-out list" prints the list of supported MIME types)
      -mif outfile input will be rendered as MIF (FrameMaker) (outfile req'd)
      Experimental feature - requires additional fop-sandbox.jar.
      -svg outfile input will be rendered as an SVG slides file (outfile req'd)
      Experimental feature - requires additional fop-sandbox.jar.

      -foout outfile input will only be XSL transformed. The intermediate
      XSL-FO file is saved and no rendering is performed.
      (Only available if you use -xml and -xsl parameters)

      [Examples]
      Fop foo.fo foo.pdf
      Fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)
      Fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf
      Fop -xml foo.xml -xsl foo.xsl -foout foo.fo
      Fop foo.fo -mif foo.mif
      Fop foo.fo -rtf foo.rtf
      Fop foo.fo -print or Fop -print foo.fo
      Fop foo.fo -awt

      Nov 6, 2011 8:59:47 AM org.apache.fop.cli.Main startFOP
      SEVERE: Exception
      org.apache.fop.apps.FOPException: No input file specified
      at org.apache.fop.cli.CommandLineOptions.checkSettings(CommandLineOptions.java:709)
      at org.apache.fop.cli.CommandLineOptions.parse(CommandLineOptions.java:147)
      at org.apache.fop.cli.Main.startFOP(Main.java:154)
      at org.apache.fop.cli.Main.main(Main.java:197)
      $

        Activity

        Hide
        Pascal Sancho added a comment -

        (In reply to comment #0)
        > It appears '-v' should be accepted.....

        This is the case: you get effectively following lines:

        > $ fop -v
        > FOP Version 0.95

        but you probably didn't specify any input files:

        > SEVERE: Exception
        > org.apache.fop.apps.FOPException: No input file specified

        Show
        Pascal Sancho added a comment - (In reply to comment #0) > It appears '-v' should be accepted..... This is the case: you get effectively following lines: > $ fop -v > FOP Version 0.95 but you probably didn't specify any input files: > SEVERE: Exception > org.apache.fop.apps.FOPException: No input file specified
        Hide
        Chris Bowditch added a comment -

        Hi Pascal,

        Jeffrey Walton raises a good point here. The -v switch on most programs just outputs the version information. Why does FOP insist on having an input file in this case and outputting usage and an error. I believe this is inconsistent and confusing for the user. We should consider changing this behaviour.

        Thanks,

        Chris

        Show
        Chris Bowditch added a comment - Hi Pascal, Jeffrey Walton raises a good point here. The -v switch on most programs just outputs the version information. Why does FOP insist on having an input file in this case and outputting usage and an error. I believe this is inconsistent and confusing for the user. We should consider changing this behaviour. Thanks, Chris
        Hide
        Pascal Sancho added a comment -

        (In reply to comment #2)
        > Jeffrey Walton raises a good point here. The -v switch on most programs just
        > outputs the version information. Why does FOP insist on having an input file in
        > this case and outputting usage and an error. I believe this is inconsistent and
        > confusing for the user. We should consider changing this behaviour.

        I didn't see it from that perspective, so I agree with you.

        Show
        Pascal Sancho added a comment - (In reply to comment #2) > Jeffrey Walton raises a good point here. The -v switch on most programs just > outputs the version information. Why does FOP insist on having an input file in > this case and outputting usage and an error. I believe this is inconsistent and > confusing for the user. We should consider changing this behaviour. I didn't see it from that perspective, so I agree with you.
        Hide
        Glenn Adams added a comment -

        (In reply to comment #3)
        > (In reply to comment #2)
        > > Jeffrey Walton raises a good point here. The -v switch on most programs just
        > > outputs the version information. Why does FOP insist on having an input file in
        > > this case and outputting usage and an error. I believe this is inconsistent and
        > > confusing for the user. We should consider changing this behaviour.
        >
        > I didn't see it from that perspective, so I agree with you.

        any progress on this pascal? should be a simple fix... i would suggest the following behavior:

        (1) if -v present but no input file, then just output version and exit
        (2) if -v present and input file specified, then output version then attempt to process input file

        Show
        Glenn Adams added a comment - (In reply to comment #3) > (In reply to comment #2) > > Jeffrey Walton raises a good point here. The -v switch on most programs just > > outputs the version information. Why does FOP insist on having an input file in > > this case and outputting usage and an error. I believe this is inconsistent and > > confusing for the user. We should consider changing this behaviour. > > I didn't see it from that perspective, so I agree with you. any progress on this pascal? should be a simple fix... i would suggest the following behavior: (1) if -v present but no input file, then just output version and exit (2) if -v present and input file specified, then output version then attempt to process input file
        Hide
        Glenn Adams added a comment -

        resetting P2 open bugs to P3 pending further review

        Show
        Glenn Adams added a comment - resetting P2 open bugs to P3 pending further review
        Hide
        Glenn Adams added a comment -

        (In reply to comment #4)
        > (In reply to comment #3)
        > > (In reply to comment #2)
        > > > Jeffrey Walton raises a good point here. The -v switch on most programs just
        > > > outputs the version information. Why does FOP insist on having an input file in
        > > > this case and outputting usage and an error. I believe this is inconsistent and
        > > > confusing for the user. We should consider changing this behaviour.
        > >
        > > I didn't see it from that perspective, so I agree with you.
        >
        > any progress on this pascal? should be a simple fix... i would suggest the
        > following behavior:
        >
        > (1) if -v present but no input file, then just output version and exit
        > (2) if -v present and input file specified, then output version then attempt to
        > process input file

        pascal?

        Show
        Glenn Adams added a comment - (In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > Jeffrey Walton raises a good point here. The -v switch on most programs just > > > outputs the version information. Why does FOP insist on having an input file in > > > this case and outputting usage and an error. I believe this is inconsistent and > > > confusing for the user. We should consider changing this behaviour. > > > > I didn't see it from that perspective, so I agree with you. > > any progress on this pascal? should be a simple fix... i would suggest the > following behavior: > > (1) if -v present but no input file, then just output version and exit > (2) if -v present and input file specified, then output version then attempt to > process input file pascal?
        Hide
        Pascal Sancho added a comment -

        (In reply to comment #4)
        > (1) if -v present but no input file, then just output version and exit
        > (2) if -v present and input file specified, then output version then attempt
        > to process input file

        I'm OK with that, it will improve both Jeffrey and Chris perspectives

        Show
        Pascal Sancho added a comment - (In reply to comment #4) > (1) if -v present but no input file, then just output version and exit > (2) if -v present and input file specified, then output version then attempt > to process input file I'm OK with that, it will improve both Jeffrey and Chris perspectives
        Hide
        Luis Bernardo added a comment -

        this bug report starts from a misunderstanding of what the -v means. it does not mean version but verbose. version is given by -version. verbose at the moment outputs the version and continues processing as if no -v is used. so verbose is really no more verbose than the default behavior.

        the submitted patch fixes the behavior as suggested in the above comments. I think this is a sensible behavior in any case, independently of -v being version or verbose.

        the patch also includes a simple unit test.

        Show
        Luis Bernardo added a comment - this bug report starts from a misunderstanding of what the -v means. it does not mean version but verbose. version is given by -version. verbose at the moment outputs the version and continues processing as if no -v is used. so verbose is really no more verbose than the default behavior. the submitted patch fixes the behavior as suggested in the above comments. I think this is a sensible behavior in any case, independently of -v being version or verbose. the patch also includes a simple unit test.
        Hide
        Luis Bernardo added a comment -

        Attachment fop_cmd_line_v.patch has been added with description: patch and simple unit test

        Show
        Luis Bernardo added a comment - Attachment fop_cmd_line_v.patch has been added with description: patch and simple unit test
        Hide
        Glenn Adams added a comment -
        Show
        Glenn Adams added a comment - applied at http://svn.apache.org/viewvc?rev=1341585&view=rev thanks luis!

          People

          • Assignee:
            fop-dev
            Reporter:
            Jeffrey Walton
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development