App-optex-scroll

 view release on metacpan or  search on metacpan

lib/App/optex/scroll.pm  view on Meta::CPAN

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
}
 
sub finalize {
    our($mod, $argv) = @_;
    #
    # private option handling
    #
    if (@$argv and $argv->[0] !~ /^-M/ and
        defined(my $i = first { $argv->[$_] eq '--' } keys @$argv)) {
        splice @$argv, $i, 1; # remove '--'
        if (local @ARGV = splice @$argv, 0, $i) {
            use Getopt::Long qw(GetOptionsFromArray);
            Getopt::Long::Configure qw(bundling);
            GetOptions \%opt, hash_to_spec \%opt or die "Option parse error.\n";
        }
    }
    my $i = first { $argv->[$_] eq '--' } keys @$argv;
    if (defined $i and $argv->[0] !~ /^-M/) {
        splice @$argv, $i, 1; # remove '--'
        if (local @ARGV = splice @$argv, 0, $i) {
            use Getopt::Long qw(GetOptionsFromArray);
            Getopt::Long::Configure qw(bundling);
            GetOptions \%opt, hash_to_spec \%opt or die "Option parse error.\n";
        }
    }
 
    my $region = $opt{line};
    flush "\n" x $region;
    flush csi_code(CPL => $region); # CPL: Cursor Previous Line
    my($l, $c) = cursor_position() or return;



( run in 0.522 second using v1.01-cache-2.11-cpan-49f99fa48dc )