Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-130

Command-line tools aren't consistent in printing doc for -usage option.

    XMLWordPrintableJSON

Details

    Description

      The tools in the bin dir do a variety of things when asked for help. Some print help with no args, others print help with -usage, some do nothing, some choke on -usage, etc. Below I've listed the tools whose Java source could be updated with a printUsage() method (or whose printUsage method could be improved), along with source code to paste into the method. In some cases, support for a -usage option will needed to be added. See other comments for each.

      Note that I've left alone those tools whose errors are merely formatting (ie, no capitalization where needed).

      // dumpxsb (org.apache.xmlbeans.impl.tool.XsbDumper)
      // This tool currently prints no help, and using -usage prints a "cannot find the file"
      // message.

      System.out.println("Prints the contents of an XSB file in human-readable form. An\n" +
      "XSB file contains schema meta information needed to perform tasks \n" +
      "such as binding and validation.\n");
      System.out.println("Usage: dumpxsb myfile.xsb");
      System.out.println(" myfile.xsb - Path to an XSB file.");
      System.out.println();

      // scopy (org.apache.xmlbeans.impl.tool.SchemaCopy)
      // Usage remark in main method should be update to show "scopy" instead of "schemacopy"
      // in syntax. Also, the -usage option prints a "badly formed URL" message.
      // In other words, use the following instead of what's there and hook up -usage.

      System.out.println("Copies the XML schema at the specified URL to the specified file.\n");
      System.out.println("Usage: scopy sourceurl [targetfile]");
      System.out.println(" sourceurl - The URL at which the schema is located.");
      System.out.println(" targetfile - The file to which the schema should be copied.");
      System.out.println();

      // sfactor (org.apache.xmlbeans.impl.tool.FactorImports)
      // The tool currently prints help when no args are specified, but the "-usage" option should be hooked in
      // to make it consistent with other tools. Also, the following should replace the text
      // that's currently in the source (which is poorly written).

      // Also, note that the UNIX version of sfactor doesn't seem to run on UNIX. Looks
      // like it suffers from the line ending problem that comes from getting saved on a
      // Windows OS.

      System.out.println("Refactors a directory of XSD files to remove name conflicts.\n");
      System.out.println("Usage: sfactor [-import common.xsd] [-out outputdir] inputdir");
      System.out.println(" -import common.xsd - The XSD file to contain redundant definitions for importing.");
      System.out.println(" -out outputdir - The directory into which to place XSD files\n" +
      " resulting from refactoring, plus a commonly imported common.xsd.");
      System.out.println(" inputdir - The directory containing the XSD files with redundant definitions.");
      System.out.println(" -license - Print license information.");
      System.out.println();

      // svalidate (org.apache.xmlbeans.impl.tool.StreamInstanceValidator)
      // Replace "switches" with "options" and fix spelling errors and formatting inconsistency.

      // As with sfactor, the UNIX version of svalidate doesn't seem to run on UNIX. Is
      // this the Windows line ending problem?

      System.out.println("Validates the specified instance against the specified schema. \n" +
      "A streaming validation useful for validating very large instance documents \n" +
      "with less memory. Contrast with the validate tool.\n");
      System.out.println("Usage: svalidate [-dl] [-nopvr] [-noupa] [-license] schema.xsd instance.xml");
      System.out.println(" -dl - Enable network downloads for imports and includes.");
      System.out.println(" -nopvr - Disable particle valid (restriction) rule.");
      System.out.println(" -noupa - Disable unique particle attribution rule.");
      System.out.println(" -license - Print license information.");
      System.out.println();

      // validate (org.apache.xmlbeans.impl.tool.InstanceValidator)

      System.out.println("Validates the specified instance against the specified schema. \n" +
      "Contrast with the svalidate tool, which validates using a stream.\n");
      System.out.println("Usage: validate [-dl] [-nopvr] [-noupa] [-license] schema.xsd instance.xml");
      System.out.println(" -dl - Enable network downloads for imports and includes.");
      System.out.println(" -nopvr - Disable particle valid (restriction) rule.");
      System.out.println(" -noupa - Disable unique particle attribution rule.");
      System.out.println(" -license - Print license information.");
      System.out.println();

      // xsdtree (org.apache.xmlbeans.impl.tool.TypeHierarchyPrinter)
      // noargs and -usage both print syntax but no descriptions.

      System.out.println("Prints the inheritance hierarchy of types defined in a schema.\n");
      System.out.println("Usage: xsdtree [-noanon] [-nopvr] [-noupa] [-partial] [-license] schemafile.xsd*");
      System.out.println(" -noanon - Don't include anonymous types in the tree.");
      System.out.println(" -nopvr - Disable particle valid (restriction) rule.");
      System.out.println(" -noupa - Disable unique particle attribution rule.");
      System.out.println(" -partial - Print only part of the hierarchy.");
      System.out.println(" -license - Print license information.");
      System.out.println(" schemafile.xsd - File containing the schema for which to print a tree.");
      System.out.println();

      Attachments

        Activity

          People

            Unassigned Unassigned
            straut Steve Traut
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: