mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-22 20:38:00 +01:00
removing old stuff
This commit is contained in:
parent
3100f4b32a
commit
90fbb875f9
2 changed files with 0 additions and 86 deletions
35
linklist.pl
35
linklist.pl
|
@ -1,35 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# ponysaylist
|
||||
# Prints a list of ponies in columns
|
||||
#
|
||||
# Licensed under WTFPL
|
||||
# See COPYING for details
|
||||
|
||||
# Author: Mattias Andrée, maandree@kth.se
|
||||
# spider-mario
|
||||
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
|
||||
my %hash;
|
||||
|
||||
{
|
||||
local @ARGV = @ARGV;
|
||||
while ((my ($source, $target), @ARGV) = @ARGV) {
|
||||
unless ($source eq $target) {
|
||||
push @{$hash{$target}}, $source;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while ((my ($source, $target), @ARGV) = @ARGV) {
|
||||
if ($source eq $target) {
|
||||
my @list = @{$hash{$source} // []};
|
||||
print $source;
|
||||
print ' (', join(' ', @list), ')' if @list;
|
||||
print "\n";
|
||||
}
|
||||
}
|
51
ponysay.sh
51
ponysay.sh
|
@ -60,62 +60,11 @@ fi
|
|||
|
||||
|
||||
|
||||
# Ponysay version print function
|
||||
version() {
|
||||
echo "ponysay v$VERSION"
|
||||
}
|
||||
|
||||
# Marks ponies in lists that have quotes
|
||||
qoutelist() {
|
||||
bash -c "$("$qlistcmd" $("$quotecmd" --list))"
|
||||
}
|
||||
|
||||
# Pony list function
|
||||
list() {
|
||||
if [ -d $SYSTEMPONIES ]; then
|
||||
echo -e "\\e[01mponyfiles located in $SYSTEMPONIES:\\e[21m"
|
||||
perl $listcmd $scrw $(ls --color=no $SYSTEMPONIES | sed -e 's/\.pony$//' | sort) | qoutelist
|
||||
fi
|
||||
if [ -d $HOMEPONIES ]; then
|
||||
echo -e "\\e[01mponyfiles located in $HOMEPONIES:\\e[21m"
|
||||
perl $listcmd $scrw $(ls --color=no $HOMEPONIES | sed -e 's/\.pony$//' | sort) | qoutelist
|
||||
fi
|
||||
if [ ! -d $SYSTEMPONIES ] && [ ! -d $HOMEPONIES ]; then
|
||||
echo >&2 "All the ponies are missing! Call the Princess!"
|
||||
fi
|
||||
}
|
||||
|
||||
# Pony list function with symlink map, for one directory
|
||||
_linklist() {
|
||||
echo -e "\\e[01mponyfiles located in $1:\\e[21m"
|
||||
files=$(ls --color=no $1 | sed -e 's/\.pony$//' | sort)
|
||||
|
||||
args=""
|
||||
|
||||
for file in $files; do
|
||||
target="$(readlink $1"/"$file".pony")"
|
||||
|
||||
if [ "$target" = "" ]; then
|
||||
target=$file
|
||||
else
|
||||
target=$(echo $target | sed -e 's/^\.\///g' -e 's/\.pony$//g')
|
||||
fi
|
||||
|
||||
args=$(echo $args $file $target)
|
||||
done
|
||||
|
||||
perl $listcmd $scrw $(perl $linklistcmd $(echo $args) | sed -e 's/ /_/g') | sed -e 's/_/ /g' | qoutelist
|
||||
}
|
||||
|
||||
# Pony list function with symlink map, for both directories
|
||||
linklist() {
|
||||
_linklist $SYSTEMPONIES
|
||||
|
||||
if [ -d $HOMEPONIES ]; then
|
||||
_linklist $HOMEPONIES
|
||||
fi
|
||||
}
|
||||
|
||||
# Pony quotes
|
||||
ponyquotes() {
|
||||
[ "$TERM" = "-linux-" ] && TERM="linux"
|
||||
|
|
Loading…
Reference in a new issue