diff options
author | Hans Hagen <pragma@wxs.nl> | 2000-10-22 00:00:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2000-10-22 00:00:00 +0200 |
commit | e78478392e9717499b101d0fed642c945c104097 (patch) | |
tree | 7f3dbe64040cbcf413644cae6516872c0fb5cd2b /context/perltk/texshow.pl | |
parent | 73000ea3b7c8225c980f40ef90b86e2d57fe4003 (diff) | |
download | context-e78478392e9717499b101d0fed642c945c104097.tar.gz |
stable 2000.10.22
Diffstat (limited to 'context/perltk/texshow.pl')
-rw-r--r-- | context/perltk/texshow.pl | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/context/perltk/texshow.pl b/context/perltk/texshow.pl new file mode 100644 index 000000000..db1ce778c --- /dev/null +++ b/context/perltk/texshow.pl @@ -0,0 +1,90 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' + if 0; + +#D \module +#D [ file=texshow.pl, +#D version=1999.03.30, +#D title=\TEXSHOW, +#D subtitle=showing \CONTEXT\ commands, +#D author=Hans Hagen, +#D date=\currentdate, +#D copyright={PRAGMA / Hans Hagen \& Ton Otten}, +#D suggestions={Tobias Burnus \& Taco Hoekwater}] +#C +#C This module is part of the \CONTEXT\ macro||package and is +#C therefore copyrighted by \PRAGMA. See licen-en.pdf for +#C details. + +#D We need to find the module path. We could have used: +#D +#D \starttypen +#D use FindBin ; +#D use lib $FindBin::Bin ; +#D \stoptypen +#D +#D But because we're sort of depending on \WEBC\ anyway, the +#D next few lines are more appropriate: + +BEGIN + { $cont_pm_path = `kpsewhich --format="other text files" --progname=context cont_mis.pm` ; + chomp($cont_pm_path) ; + $cont_pm_path =~ s/cont_mis\.pm.*// } + +use lib $cont_pm_path ; + +#D Now we can load some modules: + +use Getopt::Long ; + +$Getopt::Long::passthrough = 1 ; # no error message +$Getopt::Long::autoabbrev = 1 ; # partial switch accepted + +&GetOptions + ( "help" => \$ShowHelp , + "interface" => \$Interface ) ; + +cont_mis::banner ('TeXShow 0.1 - ConTeXt', 'PRAGMA ADE 1999') ; + +if ($ShowHelp) + { cont_mis::help ('--help', "print this help") ; + cont_mis::help ('--interface', "primary interface") ; + cont_mis::help ('string', "show info about command 'string'") ; + cont_mis::help ('string lg', "show info about 'string' in language 'lg'") ; + cont_mis::crlf () ; + exit 0 } + +use cont_mis ; +use cont_set ; + +use Tk ; + +#D This scripts is rather simple, because most of the action +#D takes place in the module \type {cont_set.pm}. + +cont_mis::status ('searching for setup files') ; + +if (cont_set::setups_found) + { cont_mis::status ('loading setups') ; + cont_set::load_setups ; + cont_mis::status ('preparing display') ; + cont_set::show_setups ; + $command = $ARGV[0] ; + $interface = $ARGV[1] ; + if ($interface) + { $Interface = $interface } + if ($Interface) + { cont_set::set_setup_interface($Interface) ; + cont_mis::message ('primary interface', $Interface) } + if ($command) + { cont_mis::message ('searching command', $command) ; + cont_set::show_setup ($command) } + else + { cont_mis::warning ('no command specified') ; + cont_set::set_setup_title('TeXShow : ConTeXt commands') } + cont_mis::status ('entering main loop') ; + MainLoop () } +else + { cont_mis::error ('no setup files found') } + +END { cont_mis::crlf ; + cont_mis::status ('closing down') } |