Author: particle Date: 2009-01-07 01:53:03 +0100 (Wed, 07 Jan 2009) New Revision: 24789
Modified: docs/Perl6/Spec/S19-commandline.pod Log: [S19] rip out option categories and services until they prove useful Modified: docs/Perl6/Spec/S19-commandline.pod =================================================================== --- docs/Perl6/Spec/S19-commandline.pod 2009-01-06 21:18:51 UTC (rev 24788) +++ docs/Perl6/Spec/S19-commandline.pod 2009-01-07 00:53:03 UTC (rev 24789) @@ -209,65 +209,6 @@ =back -=head1 Option Categories - -Perl's command line options fall into three categories: - -=over 4 - -=item * - -B<Mode> flags set Perl's operational mode (e.g. I<--doc>, I<-e>). -Only one mode flag may be specified on the command line. - -=item * - -B<Dynamic> flags may be set on the command line, via the I<PERL6OPT> -environment variable, or within a file. - -[What file? We need to be Very Careful not to delegate the identity of -the current language to anything outside of P6. I would very much hate -to see anything resembling a .perl6rc file.] - -{{ TODO clarify that i mean "source file" here and not an rc-like file }} - -=item * - -B<Static> flags may be set only on the command line, and affect the entire -run of the program. - -[I think this Static/Dynamic distinction is rather meaningless and -confusing. Certain commitments will be made by certain phases of -compilation/linking/running, and every switch is dynamic before the -commitment, static after. And Mode flags are just the ones that -commit so fast they exclude alternatives, seems like...] - -{{TODO very well, i'll shift the design to be more dynamic here}} - -=back - -For more on options and their classifications, see section -L</"Option Reference">. - - -=head1 Option Services - -Just because Perl 6 gives you a reasonable default command-line parser doesn't -mean you don't want to extend it, or replace it with something else entirely. -The command-line processor is organized into a set of services, each of which -respond to a set of command-line options. These services live in the -C<{{TODO}}> namespace, and may be overridden by loading a module with the -C<--option-parser> option (see below). - -{{ TODO more details needed }} - -[Would like to see a use case for this mechanism. The whole Services -concept seems very nebulous, especially when you start giving services -names like "Awk"..."Autoloop" would be more meaningful.] - -{{rename done}} - - =head1 Option Reference Perl 6 options, descriptions, and services. @@ -301,18 +242,12 @@ Turns on autosplit mode. -Service: Autoloop - -Notes: Annotates function produced by -n | -p - =item ++ARGSPROC [options, values] ++/ARGSPROC {{TODO don't like this name, but don't like ++CMD either}} Add a command-line processor. -Service: Option - Notes: When this option is parsed, it immediately triggers an action that could affect the remainder of the parse. Therefore, it's a good idea to put this option as early as possible in the argument list. @@ -324,16 +259,12 @@ Check syntax, then exit. -Service: Runtime - Notes: Desugars to C<++COMPILER -e 'CHECK{ compiles_ok(); exit; }' ++/COMPILER> =item --doc perldoc -Service: Doc - Notes: Desugars to C<++COMPILER -e 'CHECK{ compiles_ok(); dump_perldoc(); }' ++/COMPILER> @@ -343,8 +274,6 @@ Set debugging flags. -Service: Debugger - Notes: At least it's a start. Need a debugger spec for more. =item --execute, -e commandline @@ -356,25 +285,12 @@ your first -e on the command line should be passed a value of '6', like C<-e6>. See L<Synopsis 11|S11-modules.pod/"Forcing Perl 6"> for details. -Service: Runtime - -Notes: Returns a function that's executed unless otherwise modified by -Autoloop service's -p , -n, -a, -F. -Actually combines all source from all -e parameters, then compiles when -there are no more -e. Assigns the generated function to MAIN. - -[Not really a Mode in the sense you've defined it, but an input -redirection of a vaguely here-docish flavor. You could combine it -with -c or --doc for instance, so not exclusive.] - =item --autoloop-split, -F [string, closure, etc] Pattern to split on (used with -a). Accepts unicode strings (as long as your shell lets you pass them). Allows passing a closure (e.g. -F "{use Text::CSV}"). Awk's not better any more :) -Service: Autoloop - Notes: Substitutes a function for the default function which is { split ' ' } or whatever. @@ -382,14 +298,10 @@ Print summary of options. Desugars to C<++CMD --print-help --exit ++/CMD>. -Service: Usage - =item --include, -I Prepend directory to @*INC. -Service: Lib - Notes: this is unspecced elsewhere, so may not survive long. [at best, @*INC will only be the user's ad hoc libraries. The API for @@ -402,23 +314,10 @@ use/no module. -Service: Meta - -Notes: Maybe this happens before or affects which services are loaded. -Or maybe there can be a UNIVERSAL service which knows about other services -and is built into the interpreter. No looking at disk required? - -[I have no idea what you're talking about here...these switch are in -the same category as -n and -p; they imply additional wrapping of -the given code with extra "use" directives. The syntax could probably -use some refactoring though.] - =item --autoloop-no-print, -n Act like awk. -Service: Autoloop - Notes: Desugars to C<++PARSER --prelude=Perl6-autoloop-no-print ++/PARSER>. =item --output-format, -O format @@ -436,16 +335,12 @@ Act like sed. -Service: Autoloop - Notes: Desugars to C<++PARSER --prelude=Perl6-autoloop-print ++/PARSER>. =item --search-path, -S path Use path to search for script specified on command-line. -Service: Runtime - =item --taint, -T Turns on "taint" checking. See L<...> for details. @@ -457,8 +352,6 @@ Display program name, version, patchlevel, etc. -Service: Usage - [maybe wants to propagate -v to ++CMD, ++PARSER, ++RTS, and any other known subsystems?] @@ -470,8 +363,6 @@ Display configuration details. -Service: Usage - [likewise] =back