diff options
| author | fukachan <fukachan> | 2001-11-25 05:15:36 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-11-25 05:15:36 +0000 |
| commit | e95c5f6e35069f4f04c593c00d09b24cb2c719a4 (patch) | |
| tree | 9731054637a1c67aaeaa70a47a5535e0be65e115 /fml/lib | |
| parent | 47b5547f059f7a5917d3121ffda6e475b407e688 (diff) | |
| download | fml8-e95c5f6e35069f4f04c593c00d09b24cb2c719a4.tar.gz fml8-e95c5f6e35069f4f04c593c00d09b24cb2c719a4.tar.bz2 fml8-e95c5f6e35069f4f04c593c00d09b24cb2c719a4.zip | |
show help ASAP when --help specified
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/FML/Process/Flow.pm | 7 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Kernel.pm | 33 |
2 files changed, 26 insertions, 14 deletions
diff --git a/fml/lib/FML/Process/Flow.pm b/fml/lib/FML/Process/Flow.pm index 8f09467b..a8ccd78a 100644 --- a/fml/lib/FML/Process/Flow.pm +++ b/fml/lib/FML/Process/Flow.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Flow.pm,v 1.9 2001/04/03 09:45:43 fukachan Exp $ +# $FML: Flow.pm,v 1.10 2001/05/29 16:21:16 fukachan Exp $ # package FML::Process::Flow; @@ -66,6 +66,11 @@ sub ProcessStart # create a new process object my $process = $pkg->new($args); + # XXX private method to show help ASAP + # XXX we need to trap here since $process object is clarified after + # XXX $pkg->new() above. + $process->_trap_help($args); + # e.g. parse the incoming message (e.g. STDIN) $process->prepare($args); diff --git a/fml/lib/FML/Process/Kernel.pm b/fml/lib/FML/Process/Kernel.pm index 47245763..de75a875 100644 --- a/fml/lib/FML/Process/Kernel.pm +++ b/fml/lib/FML/Process/Kernel.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Kernel.pm,v 1.60 2001/11/04 03:46:50 fukachan Exp $ +# $FML: Kernel.pm,v 1.61 2001/11/25 03:53:00 fukachan Exp $ # package FML::Process::Kernel; @@ -130,18 +130,6 @@ sub new bless $curproc, $self; - # show help and exit here, (ASAP) - # XXX longjmp() - { - my $option = $curproc->command_line_options(); - if (defined $option->{ help }) { - if ($curproc->can('help')) { - $curproc->help(); - } - exit 0; - } - } - # load config.cf files, which is passed from loader. $curproc->load_config_files( $args->{ cf_list } ); @@ -183,6 +171,25 @@ sub _signal_init } +# Descriptions: show help and exit here, (ASAP) +# Arguments: $self $args +# Side Effects: longjmp() to help +# Return Value: none +sub _trap_help +{ + my ($curproc, $args) = @_; + my $option = $curproc->command_line_options(); + + if (defined $option->{ help }) { + print STDERR "FML::Process::Kernel trapped\n" if defined $ENV{'debug'}; + if ($curproc->can('help')) { + $curproc->help(); + } + exit 0; + } +} + + =head2 C<prepare($args)> preparation before the main part starts. |
