Changeset 34437 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jun 7, 2008, 8:50:33 PM (17 years ago)
Author:
[email protected]
Message:

2008-06-07 Cameron Zwarich <[email protected]>

Reviewed by Dan Bernstein.

Bug 17928: testkjs shouldn't require "-f"
<https://bugs.webkit.org/show_bug.cgi?id=17928>

  • kjs/testkjs.cpp: (printUsageStatement): (parseArguments):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r34429 r34437  
     12008-06-07  Cameron Zwarich  <[email protected]>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Bug 17928: testkjs shouldn't require "-f"
     6        <https://bugs.webkit.org/show_bug.cgi?id=17928>
     7
     8        * kjs/testkjs.cpp:
     9        (printUsageStatement):
     10        (parseArguments):
     11
    1122008-06-07  Cameron Zwarich  <[email protected]>
    213
  • trunk/JavaScriptCore/kjs/testkjs.cpp

    r34429 r34437  
    327327static void printUsageStatement()
    328328{
    329     fprintf(stderr, "Usage: testkjs -f file1 [-f file2...][-p][-- arguments...]\n");
     329    fprintf(stderr, "Usage: testkjs [options] [files] [-- arguments]\n");
     330    fprintf(stderr, "  -f  Specifies a source file (deprecated)\n");
     331    fprintf(stderr, "  -p  Prints formatted source code\n");
     332    fprintf(stderr, "  -d  Dumps bytecode (debug builds only)\n");
     333    fprintf(stderr, "  -s  Installs signal handlers that exit on a crash (Unix platforms only)\n");
    330334    exit(-1);
    331335}
     
    333337static void parseArguments(int argc, char** argv, Vector<UString>& fileNames, Vector<UString>& arguments, bool& prettyPrint, bool& dump)
    334338{
    335     if (argc < 3)
     339    if (argc < 2)
    336340        printUsageStatement();
    337341
     
    366370            break;
    367371        }
    368         break;
    369     }
    370 
     372        fileNames.append(argv[i]);
     373    }
     374   
     375    if (fileNames.isEmpty())
     376        printUsageStatement();
     377   
    371378    for (; i < argc; ++i)
    372379        arguments.append(argv[i]);
Note: See TracChangeset for help on using the changeset viewer.