/usr/share/doc/libterm-shellui-perl/examples/synopsis is in libterm-shellui-perl 0.92-2.
This file is owned by root:root, with mode 0o755.
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 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #!/usr/bin/perl -w
# Example code from the module's POD to ensure that it actually works.
# Just three simple commands to show argument handling and completion.
# This file is released under the MIT license.
use strict;
use lib '../lib';
use Term::ShellUI;
my $term = new Term::ShellUI(
commands => {
"cd" => {
desc => "Change to directory DIR",
maxargs => 1, args => sub { shift->complete_onlydirs(@_); },
proc => sub { chdir($_[0] || $ENV{HOME} || $ENV{LOGDIR}); },
},
"pwd" => {
desc => "Print the current working directory",
maxargs => 0, proc => sub { system('pwd'); },
},
"quit" => {
desc => "Quit using Fileman", maxargs => 0,
method => sub { shift->exit_requested(1); },
}},
history_file => '~/.shellui-synopsis-history',
);
print 'Using '.$term->{term}->ReadLine."\n";
$term->run(@ARGV);
|