From 9cd15a354236f8808ab55ef61ef0d8d7a30dabd0 Mon Sep 17 00:00:00 2001 From: Sean O'Rourke Date: Sat, 12 May 2012 06:47:59 -0600 Subject: [PATCH] Shorten text and change Sepia::flow() to shorten ",help" output. --- README | 2 ++ lib/Sepia.pm | 12 ++++++------ lib/Sepia/Debug.pm | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README b/README index 8bc5aa6..7b21a31 100644 --- a/README +++ b/README @@ -94,6 +94,8 @@ Emacs-style ChangeLog entry. ** (Hard) Add appropriate hooks Possibly update existing functions to make use of hooks for better modularity. +** (Easy) Make Sepia::flow() work +It should keep adding words until a line is too long. * KNOWN BUGS The following is a list of bugs that are difficult to automatically reproduce, with the dates they were first observed. diff --git a/lib/Sepia.pm b/lib/Sepia.pm index 082fd88..d03bedb 100644 --- a/lib/Sepia.pm +++ b/lib/Sepia.pm @@ -878,10 +878,10 @@ sub Dump sub flow { - my $n = shift; - my $n1 = int(2*$n/3); + my $n = shift()-1; + my $n1 = $n-8; # XXX: arbitrary number local $_ = shift; - s/(.{$n1,$n}) /$1\n/g; + s/(.{$n1,$n}) +/$1\n/g; $_ } @@ -1008,7 +1008,7 @@ sub define_shortcuts { define_shortcut 'help', \&Sepia::repl_help, 'help [CMD]', - 'Display help on all commands, or just CMD.'; + 'Display help on all commands or CMD.'; define_shortcut 'cd', \&Sepia::repl_chdir, 'cd DIR', 'Change directory to DIR'; define_shortcut 'pwd', \&Sepia::repl_pwd, @@ -1024,7 +1024,7 @@ sub define_shortcuts define_shortcut 'wantarray', \&Sepia::repl_wantarray, 'wantarray [0|1]', 'Set or toggle evaluation context'; define_shortcut 'format', \&Sepia::repl_format, - 'format [TYPE]', "Set output formatter to TYPE (one of 'dumper', 'dump', 'yaml', 'plain'; default: 'dumper'), or show current type."; + 'format [TYPE]', "Set output format to TYPE ('dumper', 'dump', 'yaml', or 'plain'; default: 'dumper') or show current type."; define_shortcut 'strict', \&Sepia::repl_strict, 'strict [0|1]', 'Turn \'use strict\' mode on or off'; define_shortcut 'quit', \&Sepia::repl_quit, @@ -1051,7 +1051,7 @@ sub define_shortcuts define_shortcut save => \&Sepia::repl_save, 'save [PATTERN [FILE]]', 'Save variables matching PATTERN to FILE.'; define_shortcut reload => \&Sepia::repl_reload, - 'reload [MODULE | /RE/]', 'Reload MODULE, or all modules matching RE.'; + 'reload [MODULE | /RE/]', 'Reload MODULE or all modules matching RE.'; define_shortcut freload => \&Sepia::repl_full_reload, 'freload MODULE', 'Reload MODULE and all its dependencies.'; define_shortcut time => \&Sepia::repl_time, diff --git a/lib/Sepia/Debug.pm b/lib/Sepia/Debug.pm index c77416c..7d4412b 100644 --- a/lib/Sepia/Debug.pm +++ b/lib/Sepia/Debug.pm @@ -322,7 +322,7 @@ sub add_repl_commands 'debug [0|1]', 'Enable or disable debugging.'; define_shortcut 'break', \&repl_break, 'break [F:N [E]]', - 'Break at file F, line N (or at current position) if E is true.'; + 'Break at file F, line N (or current) if E.'; define_shortcut 'lsbreak', \&repl_lsbreak, 'List breakpoints.'; # define_shortcut 'dbsub', \&repl_dbsub, '(Un)install DB::sub.'; -- 2.11.4.GIT