/usr/share/elvis/scripts/reverse.ex is in elvis-common 2.2.0-11.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | "This script defines a :reverse alias, which reverses the order of the
"characters in a line. By default it acts on the current line, but you
"can also give it a range of lines to alter. Leading whitespace is
"unaffected.
alias reverse {
"Reverse the characters in a line
!(.)% g /\S/ {
local t=true
s/^\s*/&<@>/
while t
do {
try s/\(<@>.*\)\(.\)/\2\1/
else set t=false
}
s/<@>$/
}
}
|