76 lines
1.8 KiB
Diff
76 lines
1.8 KiB
Diff
|
|
From e359d5d205ffccae2a5ca86740084fc53dccf0a5 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Mark Nudelman <markn@greenwoodsoftware.com>
|
||
|
|
Date: Tue, 11 Oct 2022 21:22:14 -0700
|
||
|
|
Subject: [PATCH 17/48] Obsolete file
|
||
|
|
|
||
|
|
---
|
||
|
|
lesstest/gen | 56 ----------------------------------------------------
|
||
|
|
1 file changed, 56 deletions(-)
|
||
|
|
delete mode 100755 lesstest/gen
|
||
|
|
|
||
|
|
diff --git a/lesstest/gen b/lesstest/gen
|
||
|
|
deleted file mode 100755
|
||
|
|
index 00dbf62..0000000
|
||
|
|
--- a/lesstest/gen
|
||
|
|
+++ /dev/null
|
||
|
|
@@ -1,56 +0,0 @@
|
||
|
|
-#!/usr/bin/perl
|
||
|
|
-use strict;
|
||
|
|
-
|
||
|
|
-# Generate a lesstest file.
|
||
|
|
-
|
||
|
|
-my $usage = "usage: [LT_LESSVAR=value]... gen [-w#] [-h#] less.exe [lessflags] textfile\n";
|
||
|
|
-
|
||
|
|
-use Getopt::Std;
|
||
|
|
-
|
||
|
|
-my $testdir = ".";
|
||
|
|
-my $lesstest = "$testdir/lesstest";
|
||
|
|
-my $outdir = "$testdir/suite";
|
||
|
|
-
|
||
|
|
-exit (main() ? 0 : 1);
|
||
|
|
-sub main {
|
||
|
|
- my %opt;
|
||
|
|
- die $usage if not getopts('h:w:', \%opt);
|
||
|
|
- my ($width, $height) = term_size();
|
||
|
|
- $width -= 2 if $width > 2;
|
||
|
|
- $height -= 1 if $height > 1;
|
||
|
|
- $width = $opt{w} if $opt{w};
|
||
|
|
- $height = $opt{h} if $opt{h};
|
||
|
|
-
|
||
|
|
- die $usage if @ARGV < 2;
|
||
|
|
- my $less = $ARGV[0];
|
||
|
|
- my $file = $ARGV[$#ARGV];
|
||
|
|
- die $usage if not defined $less or not defined $file;
|
||
|
|
- if (not -f $file) {
|
||
|
|
- print "$0: cannot open $file\n";
|
||
|
|
- return 0;
|
||
|
|
- }
|
||
|
|
- my ($base) = $file;
|
||
|
|
- if ($base =~ m|.*/([^/]+)$|) { $base = $1; }
|
||
|
|
-
|
||
|
|
- my $outfile;
|
||
|
|
- for (my $n = 1;; ++$n) {
|
||
|
|
- $outfile = "$outdir/$base-$n.lt";
|
||
|
|
- last if not -s $outfile;
|
||
|
|
- }
|
||
|
|
-
|
||
|
|
- my $cmd = '';
|
||
|
|
- $cmd .= "LT_COLUMNS=$width " if $width > 0;
|
||
|
|
- $cmd .= "LT_LINES=$height " if $height > 0;
|
||
|
|
- $cmd .= "$lesstest -s $testdir/lt_screen -o $outfile -- " . join(' ', @ARGV);
|
||
|
|
- if (system $cmd) {
|
||
|
|
- print "$0: error running $lesstest\n";
|
||
|
|
- }
|
||
|
|
- return 1;
|
||
|
|
-}
|
||
|
|
-
|
||
|
|
-sub term_size {
|
||
|
|
- my $stty = `stty -a`;
|
||
|
|
- my ($x, $lines) = $stty =~ /(rows|lines)\s+(\d+)/;
|
||
|
|
- my ($columns) = $stty =~ /columns\s+(\d+)/;
|
||
|
|
- return ($columns, $lines);
|
||
|
|
-}
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|