diff options
author | jake <jake@jakes-mail.top> | 2022-01-19 19:53:29 -0500 |
---|---|---|
committer | jake <jake@jakes-mail.top> | 2022-01-19 19:53:29 -0500 |
commit | 5f750167f4d6b89ffd1c534dde00b08d7ed4482d (patch) | |
tree | 1e5e4511e1d48e364dee3b4a366001247fb176ea | |
parent | 02d4f062542e7632ba116ffeed8536e90892a619 (diff) |
toggle() now toggles without calling external function
-rwxr-xr-x | gmi.pl | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -10,7 +10,7 @@ use bytes; use feature qw(refaliasing); no warnings qw(experimental::refaliasing); -our $VERSION = 'v0.0.21'; +our $VERSION = 'v0.0.22'; # TODO: # back() only works once; should fix this @@ -82,7 +82,7 @@ my %commands = ( 'display' => [sub { display() }, 'Display the current page.' ], 'd' => [sub { display() }, 'Alias of `display\'.' ], - 'usepager' => [sub { toggle('pager') }, 'This toggles pager use. 1 = use pager, 0 = stdout.' ], + 'usepager' => [sub { toggle($use_pager) }, 'This toggles pager use. 1 = use pager, 0 = stdout.' ], 'textwrap' => [sub { textwrap($_[0]) }, 'Set textwrap length.\nGiving \'auto\' will ' . "automatically determine the appropriate length. (Currently $wrapper->{columns})"], 'pager' => [sub { pager($_[0]) }, "Set which pager to use. (currently $ENV{pager})"], @@ -498,14 +498,6 @@ sub display { } sub toggle { - my ($t) = @_; - if ($t eq 'pager') { - set_toggle($use_pager); - print "$use_pager\n"; - } -} - -sub set_toggle { # refaliasing \my $t = \$_[0]; if ($t == 1) { @@ -514,6 +506,7 @@ sub set_toggle { else { $t = 1; } + print "$t\n"; } sub textwrap { |