perl 4.0 patch 14: patch #11, continued
[p5sagit/p5-mst-13.2.git] / msdos / usage.c
CommitLineData
fe14fcc3 1/* usage.c
2 *
3 * Show usage message.
4 */
5
6#include <stdio.h>
7#include <string.h>
8
9
10usage(char *myname)
11{
12char * p;
13char * name_p;
14
15name_p = myname;
16if ( p = strrchr(myname,'/') )
17 name_p = p+1; /* point after final '/' */
18#ifdef MSDOS
19if ( p = strrchr(name_p,'\\') )
20 name_p = p+1; /* point after final '\\' */
21if ( p = strrchr(name_p,':') )
22 name_p = p+1; /* point after final ':' */
23 printf("\nUsage: %s [-acdnpsSvw] [-Dnumber] [-i[extension]] [-Idirectory]"
24#else
25 printf("\nUsage: %s [-acdnpPsSuUvw] [-Dnumber] [-i[extension]] [-Idirectory]"
26#endif
27 "\n [-e \"command\"] [-x[directory]] [filename] [arguments]\n", name_p);
28
29 printf("\n -a autosplit mode with -n or -p"
30 "\n -c syntaxcheck only"
31 "\n -d run scripts under debugger"
32 "\n -n assume 'while (<>) { ...script... }' loop arround your script"
33 "\n -p assume loop like -n but print line also like sed"
34#ifndef MSDOS
35 "\n -P run script through C preprocessor befor compilation"
36#endif
37 "\n -s enable some switch parsing for switches after script name"
38 "\n -S look for the script using PATH environment variable");
39#ifndef MSDOS
40 printf("\n -u dump core after compiling the script"
41 "\n -U allow unsafe operations");
42#endif
43 printf("\n -v print version number and patchlevel of perl"
44 "\n -w turn warnings on for compilation of your script\n"
45 "\n -Dnumber set debugging flags"
46 "\n -i[extension] edit <> files in place (make backup if extension supplied)"
47 "\n -Idirectory specify include directory in conjunction with -P"
48 "\n -e command one line of script, multiple -e options are allowed"
49 "\n [filename] can be ommitted, when -e is used"
50 "\n -x[directory] strip off text before #!perl line and perhaps cd to directory\n");
51}