diff options
author | Jim Cromie <jcromie@cpan.org> | 2004-05-10 09:25:07 -0600 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2004-05-10 22:12:31 +0000 |
commit | e6e64d9b6c1057c83dca54b17271a740a0d508f6 (patch) | |
tree | 574e5d4e81dfbdde84565d29d1e8259cef996dba /perl.c | |
parent | c6dfe06b011d5e45b77ada4c240cf5565f0b354a (diff) | |
download | perl-e6e64d9b6c1057c83dca54b17271a740a0d508f6.tar.gz |
Re: a little extra cmdline help. [PATCH]
Message-Id: <409FF333.4020104@divsol.com>
p4raw-id: //depot/perl@22806
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 45 |
1 files changed, 39 insertions, 6 deletions
@@ -2382,6 +2382,33 @@ NULL int Perl_get_debug_opts(pTHX_ char **s) { + static char *usage_msgd[] = { + " Debugging flag values: (see also -d)", + " p Tokenizing and parsing (with v, displays parse stack)", + " s Stack snapshots. with v, displays all stacks", + " l Context (loop) stack processing", + " t Trace execution", + " o Method and overloading resolution", + " c String/numeric conversions", + " P Print profiling info, preprocessor command for -P, source file input state", + " m Memory allocation", + " f Format processing", + " r Regular expression parsing and execution", + " x Syntax tree dump", + " u Tainting checks (Obsolete, previously used for LEAKTEST)", + " H Hash dump -- usurps values()", + " X Scratchpad allocation", + " D Cleaning up", + " S Thread synchronization", + " T Tokenising", + " R Include reference counts of dumped variables (eg when using -Ds)", + " J Do not s,t,P-debug (Jump over) opcodes within package DB", + " v Verbose: use in conjunction with other flags", + " C Copy On Write", + " A Consistency checks on internal structures", + " q quiet - currently only suppressed the 'EXECUTING' message", + NULL + }; int i = 0; if (isALPHA(**s)) { /* if adding extra options, remember to update DEBUG_MASK */ @@ -2392,14 +2419,18 @@ Perl_get_debug_opts(pTHX_ char **s) if (d) i |= 1 << (d - debopts); else if (ckWARN_d(WARN_DEBUGGING)) - Perl_warner(aTHX_ packWARN(WARN_DEBUGGING), - "invalid option -D%c\n", **s); + Perl_warner(aTHX_ packWARN(WARN_DEBUGGING), + "invalid option -D%c, use -D'' to see choices\n", **s); } } - else { + else if (isDIGIT(**s)) { i = atoi(*s); for (; isALNUM(**s); (*s)++) ; } + else { + char **p = usage_msgd; + while (*p) PerlIO_printf(PerlIO_stdout(), "%s\n", *p++); + } # ifdef EBCDIC if ((i & DEBUG_p_FLAG) && ckWARN_d(WARN_DEBUGGING)) Perl_warner(aTHX_ packWARN(WARN_DEBUGGING), @@ -2514,7 +2545,7 @@ Perl_moreswitches(pTHX_ char *s) #else /* !DEBUGGING */ if (ckWARN_d(WARN_DEBUGGING)) Perl_warner(aTHX_ packWARN(WARN_DEBUGGING), - "Recompile perl with -DDEBUGGING to use -D switch\n"); + "Recompile perl with -DDEBUGGING to use -D switch (did you mean -d ?)\n"); for (s++; isALNUM(*s); s++) ; #endif /*SUPPRESS 530*/ @@ -3095,8 +3126,10 @@ S_open_script(pTHX_ char *scriptname, bool dosearch, SV *sv) #endif /* IAMSUID */ if (!PL_rsfp) { /* PSz 16 Sep 03 Keep neat error message */ - Perl_croak(aTHX_ "Can't open perl script \"%s\": %s\n", - CopFILE(PL_curcop), Strerror(errno)); + + Perl_croak(aTHX_ "Can't open perl script \"%s\": %s%s\n", + CopFILE(PL_curcop), Strerror(errno), + ". Use -S to search $PATH for it"); } } |