• Publicidad

Ayuda para agregar -help a script

¿Apenas comienzas con Perl? En este foro podrás encontrar y hacer preguntas básicas de Perl con respuestas aptas a tu nivel.

Ayuda para agregar -help a script

Notapor pablgonz » 2010-12-14 17:05 @753

Hola, hace un tiempo me uní a este foro para solucionar un pequeño problema con un script que uso en TeX. Ahora tengo otro problema, deseo añadir la opción -h al script pst2pdf, es decir, comentar la línea 363 y con Getopt::Long; y Pod::Usage; crear la ayuda de dicho script, pero, todos mis intentos han fracasado, el script solo me dice que tengo un error en la línea 77 (arroja Unknow option -h); además, me crea el fichero -h-pdf.tex. O -loquesea-pdf.tex.
Lo he intentado de varias maneras, pero el script es un tanto complejo para mi, logro crear la ayuda en otros ficheros y script pequeños, pero no en éste.
Agradezco de antemano por su ayuda.

Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
  1. eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
  2.   if 0;
  3.  
  4. use strict;                             # to be sure, that all is safe ... :-)
  5.  
  6. # v. 0.10                               simplify the use of PSTricks with pdf
  7. # 2010-01-04    (c) Herbert Voss <[email protected]>
  8. # $Id: pst2pdf.pl 239 2010-01-01 17:23:13Z herbert $
  9. # Thanks to Pablo Gonzales
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or (at
  14. # your option) any later version.
  15. #
  16. # This program is distributed in the hope that it will be useful, but
  17. # WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  19. # See the GNU General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with this program; if not, write to the
  23. # Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. # MA  02111-1307  USA
  25. #
  26. use File::Path;                         # creating/removing dirs
  27. use File::Copy;                         # copying files
  28. use File::Basename;                     # scan argument
  29. use IO::File;                           # simple IO operation
  30. use Getopt::Long;                       # read parameter
  31.  
  32. #----------------------- User part begin ------------------------
  33. my $imageDir = "images";                # where to save the images
  34. my @imageType = ("eps","pdf");          # all image types
  35. push (@imageType, "png") if $^O ne 'MSWin32';
  36. my $Iext = ".pdf";                      # leave empty, if not a special one
  37. my $tempDir = ".";                      # temporary directory
  38. my $verbose = 1;                        # 0 or 1, logfile  
  39. my $clear = 0;                          # 0 or 1, clears all temporary files
  40. my $DPI = 75;                           # very low value for the png's
  41. my $Iscale = 1;                         # for \includegraphics
  42. my $noImages = 0;                       # 1->create no images
  43. #----------------------- User part end ---------------------------
  44.  
  45. @ARGV == 0 && die "file name expected!\n";
  46.  
  47. my @SuffixList = (".tex","",".ltx");                    # possible extensions
  48. my ($name,$path,$ext) = fileparse($ARGV[0],@SuffixList);
  49. if ( $ext eq "" ) { $ext = ".tex"; }                    # me need the extension as well
  50. my $TeXfile = "$path$name$ext";
  51. my $Logfile = "$tempDir/$name.plog";                    # our own log file
  52. open (LOGfile, ">$Logfile") or die "cannot open $Logfile!";
  53.  
  54. my $result = GetOptions ("DPI=i"      => \$DPI,         # numeric
  55.                          "Iscale=f"   => \$Iscale,      # real
  56.                          "imageDir=s" => \$imageDir,    # string
  57.                          "tempDir=s"  => \$tempDir,     # string
  58.                          "Iext=s"     => \$Iext,        # string
  59.                          "clear"      => \$clear,       # flag
  60.                          "noImages"   => \$noImages,    # flag
  61.                          "verbose"    => \$verbose);    # flag
  62.  
  63. LOG ("Parameters:");
  64. LOG ("==> imageDir = $imageDir");
  65. LOG ("==> Iext     = $Iext");
  66. LOG ("==> DPI      = $DPI");
  67. LOG ("==> Iscale   = $Iscale");
  68. LOG ("==> tempDir  = $tempDir");
  69. LOG ("==> verbose  = $verbose");
  70. LOG ("==> clear    = $clear");
  71. LOG ("==> noImages = $noImages");
  72.  
  73. my $imgNo = 0;                          # internal image counter
  74. my $pstExaLoaded = 0;                   # Document loads pst-exa
  75.  
  76. LOG ("Running on [$path][$name][$ext]");
  77. open (FILE, "<$TeXfile") or die "cannot open source file $TeXfile!";    # the source
  78. if ( !$noImages ) {
  79.   if (-d $imageDir) { LOG ("$imageDir exists") }
  80.   else { mkdir("$imageDir", 0744) || die "cannot mkdir $imageDir: $!";
  81.     LOG ("Imagedir created"); }
  82.  
  83.   LOG ("go to savePreamble ... ");
  84.   savePreamble($name);
  85.   LOG ("done!\n go to runFile ...");
  86.   runFile($name);
  87.   LOG ("done!");
  88.   close FILE;                                           # close source file
  89. }# !noImages
  90.  
  91.  
  92. LOG ("runpdfTeX ... ");
  93. runpdfTeX("$path$name",$name);
  94. LOG ("all finished ... :-)");
  95. close LOGfile;
  96. if ( $clear ) {
  97.   unlink "$path$name.aux";
  98.   unlink "$path$name.log";
  99.   unlink "$path$name.preamble";
  100.   unlink "$path$name-tmp.aux";
  101.   unlink "$path$name-tmp.dvi";
  102.   unlink "$path$name-tmp.log";
  103.   unlink "$path$name-tmp.pdf";
  104.   unlink "$path$name-tmp.ps";
  105.   unlink "$path$name-tmp.tex";
  106. }
  107.  
  108. sub savePreamble {                      # create a preamble file
  109. # if we have a \input command inside the preamble, it doesn't hurt, we need
  110. # it anyway for the postscript files and the pdf one.
  111.   my $filename = pop;                   # get the file name
  112.   LOG ("----- Start Preamble -----");
  113.   open (FILEp, ">$tempDir/$filename.preamble")
  114.     or die "cannot open preamble file $tempDir/$filename.preamble!";
  115.   while (<FILE>) {                      # read all until \begin{document}
  116.     $pstExaLoaded = index($_,"usepackage{pst-exa}");
  117.     my $i = index($_,"begin{document}");
  118.     if ($i > 0) {
  119.       if ($i > 1) { print FILEp substr($_,0,--$i); }    # write all until \begin{document}
  120.       print FILEp "\n\\usepackage{pst-exa}\n";
  121.       close(FILEp);                                     # close preamble
  122.       LOG ("----- Close Preamble ------");
  123.       return;
  124.     } else {
  125.       print FILEp "$_";                                 # write into preamble
  126.       LOG ("$_");
  127.     }
  128.   }
  129.   close(FILEp);
  130.   if ( $verbose ) { LOG("<-----Preamble<----"); }
  131.   return;
  132. }
  133.  
  134. sub searchPS {                                  # search the PostScript parts
  135.   my @PS = ();                                  # single PS sequence
  136.   my @PStotal = ();                             # all PS sequences as list of arrays
  137.   my $depth = -1;                               # counts nested macros
  138.   my $type = -1;                                # -1-> none; 1->PST; 2->PS;
  139.   my $EndDocument = 0;                          # ignore all after \end{document}
  140.   my $iVerb = 0;                                # test for verbatim or lstlisting environment, must be ignored
  141.   while (<FILE>) {                              # scan the input file
  142.     if (!$EndDocument) {
  143.     chomp;                                      # delete EOL character
  144.     my $line = $_;                              # save line
  145.     if ( !$iVerb ) {
  146.       $iVerb = ((index($line,"begin{verbatim}") > 0) or (index($line,"begin{lstlisting}") > 0));
  147.     }                                           # do nothing until \end{verbatim}
  148.     if ( !$iVerb ) {
  149.       my $iPS = index($line,"begin{postscript}");
  150.       my $iPST = index($line,"begin{pspicture*}");
  151.       if ($iPST < 0) { $iPST = index($line,"begin{pspicture}"); }       # alternative
  152.       if ($iPST < 0) { $iPST = index($line,"pspicture"); }      # alternative \pspicture...
  153.       if (($iPS > 0) && ( $type == 1 )){ print "postscript environment must be of outer level!\n"; exit 1; }
  154.       if ( $type < 0 ) {                        # no active environment
  155.         if ($iPS > 0) {                         # we have \begin{postscript}
  156.           $type = 2;                   
  157.           $line = substr($line,$iPS-1);         # add rest of the line
  158.           LOG("PS-Zeile: $line");
  159.         }                              
  160.         elsif ( $iPST > 0 ) {                   # we have \begin{pspicture} or \pspicture
  161.           $type = 1;
  162.           $depth++;  
  163.           $line = substr($line,$iPST-1);        # add all unitl pspicture
  164.           LOG("PST-Zeile: $line");
  165.         }
  166.       }
  167. #       we have now \begin{pspicture} or \begin{postscript}
  168.       if ($type > 0) {                          # start Scan, we have an environment
  169.         LOG ("searchPS: set \$type=$type");
  170.         $iPST = index($line,"end{pspicture*}");
  171.         if ($iPST < 0) { $iPST = index($line,"end{pspicture}"); }       # alternative
  172.         if ($iPST < 0) { $iPST = index($line,"endpspicture"); } # alternative \endpspicture...
  173.         $iPS = index($line,"end{postscript}"); 
  174.         if ($iPST > 0) {                        # test, we can have postscript and pspicture in one line
  175.           if ( $type < 2) {                     # found end of pspicture environment
  176.             LOG ("searchPS: $line");
  177.             $depth--;
  178.             if ($depth < 0) {
  179.               $type = -1;
  180.               if (index($line,"endpspicture") > 0)              # add line, depends to type
  181.                    { push @PS,substr($line,0,$iPST+12); }       # \endpspicture
  182.               elsif (index($line,"pspicture*") > 0)
  183.                       { push @PS,substr($line,0,$iPST+15); }    # \end{pspicture}
  184.               else { push @PS,substr($line,0,$iPST+14); }       # \end{pspicture}
  185.               LOG ("searchPS: set \$type=$type");
  186.               push @PStotal,[@PS];      # add PS sequence
  187.               LOG ("---->PS---->\n@PS\n<----PS<----");
  188.               @PS = ();                 # start new PS sequence
  189.             }                           # no pspicture env left
  190.           } else { push @PS,$line; }    # pspicture inside postscript
  191.         } elsif ($iPS > 0) {            # must be type=1 -> stop Scan
  192.           LOG ("searchPS: $line");
  193.           $type = -1;
  194.           push @PS,substr($line,0,$iPS+15);# add line
  195.           LOG ("searchPS: set \$type=$type");
  196.           push @PStotal,[@PS];          # add PS sequence
  197.           LOG ("---->PS---->\n@PS\n<----PS<----");
  198.           @PS = ();                     # start new PS sequence
  199.         } else { push @PS,$line; }              # add line
  200.       }
  201.       my $i = index($line,"end{document}");
  202.       if ($i > 0) { $EndDocument++; LOG("EndDocument in searchPS"); }
  203.     } # if ( $iVerb )
  204.     if (( index($line,"end{verbatim}") > 0 ) or ( index($line,"end{lstlisting}") > 0 )) { $iVerb = 0; }
  205.   }}
  206.   if ( $verbose ) {
  207.     LOG("---->PStotal---->");
  208.     for my $aref ( @PStotal ) {
  209.       my @a = @$aref;
  210.       my $i = 0;
  211.       foreach ( @a ) { LOG ($a[$i]); $i++; }
  212.     }
  213.     LOG ("<----PStotal<----");
  214.   }
  215.   close(FILE);
  216.   return @PStotal;                      # return all PS sequences
  217. }
  218.  
  219. sub runTeX {
  220.   my $filename = pop;
  221.   system("latex $filename"); # or die "Error in the LaTeX run from file $filename!";
  222.   system("dvips $filename"); # or die "Error in the dvips run from file $filename!";
  223.   system("ps2pdf $filename.ps");# or die "Error in the ps2pdf run from file $filename!";
  224.   copy("$filename.tex", "$imageDir/$filename-$imgNo.tex") or die "Cannot copy Source file!";;
  225.   for my $Itype ( @imageType ) {
  226.     if ($Itype eq "pdf") { system("pdfcrop $filename.pdf $imageDir/$filename-$imgNo.pdf");  }
  227.     if ($Itype eq "png") {
  228.       system("pdftoppm -f 1 -l 1 -r $DPI $imageDir/$filename-$imgNo.pdf $imageDir/");
  229.       system("convert $imageDir/-1.ppm  $imageDir/$filename-$imgNo.png");
  230.       system("rm $imageDir/-1.ppm");
  231.     }
  232.     if ($Itype eq "eps") { system("pdftops -f 1 -l 1 -eps $imageDir/$filename-$imgNo.pdf $imageDir/$filename-$imgNo.eps"); }
  233.   }
  234.   $imgNo++;
  235. }
  236.  
  237. sub runFile {
  238.   my $filename = pop;
  239.   my @PSarray = searchPS();
  240.   if ( $verbose ) {
  241.     LOG("---->PSarray---->");
  242.     for my $aref ( @PSarray ) {
  243.       my @a = @$aref;
  244.       my $i = 0;
  245.       foreach ( @a ) { print LOG $a[$i]."\n"; $i++; }
  246.     }
  247.     LOG("<----PSarray<----");
  248.     my $no = @PSarray;
  249.     LOG("PS: ".$no." PS sequence(s)");
  250.   }
  251.   for my $aref ( @PSarray ) {
  252.     my @PS = @$aref;
  253.     open (FILEp, "<$tempDir/$filename.preamble") or die "cannot open $tempDir/$filename.preamble!";
  254.     open (FILEsub, ">$tempDir/$filename-tmp.tex") or die "cannot open $tempDir/$filename-tmp.tex!";
  255. #    print FILEsub "\\RequirePackage{listings}\n";
  256.     while (<FILEp>) { print FILEsub $_; }
  257.     print FILEsub "\\pagestyle{empty}\n";
  258.     print FILEsub "\\newenvironment{postscript}{}{}\n";
  259.     print FILEsub "\\providecommand\\IncludeGraphics[2][]{}\n";
  260.     print FILEsub "\\begin{document}\n";
  261.     if ( $verbose ) { LOG("\@PS: $_"); }
  262.     foreach ( @PS ) { print FILEsub "$_\n"; }
  263.     print FILEsub "\\end{document}\n";
  264.     close (FILEsub);
  265.     close (FILEp);
  266.     runTeX("$tempDir/$filename-tmp");
  267.   }
  268. }
  269.  
  270. sub runpdfTeX() {
  271.   my ($name,$pdfname) = @_;
  272.   open (PDF, ">$tempDir/$pdfname-pdf.tex") or die "cannot open $tempDir/$pdfname-pdf.tex!";
  273.   open (FILE, "<$name.tex") or die "cannot open $name!";
  274.   print PDF "\\RequirePackage{graphicx}\n";
  275. #  if ($pstExaLoaded < 1) {
  276. #    print PDF "\\AtBeginDocument{\\let\\IncludeGraphics\\includegraphics}\n"; }
  277. #  print PDF "\\setkeys{Gin}{scale=0.25}\n";
  278. #  print PDF "\\providecommand\\psset[1]{}\n";
  279.   print PDF "\\graphicspath{{$imageDir/}}\n"; #uncomment
  280.   my $ignore = 0;
  281.   my $IMGno = 0;
  282.   my $depth = -1;
  283.   my $type = -1;
  284.   my $EndDocument = 0;                  # ignore all after \end{document}
  285.   my $iVerb = 0;
  286.   while (<FILE>) {                      # scan the input file
  287.     if ( !$iVerb ) {
  288.       $iVerb = ((index($_,"begin{verbatim}") > 0) or (index($_,"begin{lstlisting}") > 0));
  289.     } # do nothing until \end{verbatim}|| \end{lstlisting}
  290.     if ( !$iVerb ) {
  291.       my $i = index($_,"end{document}");
  292.       if ($i > 0) { print PDF $_; $EndDocument++; LOG("EndDocument in runpdfTeX"); }
  293.       if ( !$EndDocument ) {
  294.         my $iPS = index($_,"begin{postscript}");
  295.         if ( $iPS > 0 ) {
  296.           $type = 2;
  297.           $ignore = 1;
  298.           if ($iPS > 1) { print PDF substr($_,0,--$iPS); }      # add preceeding text
  299.          print PDF "\\IncludeGraphics[scale=$Iscale]{$pdfname-tmp-$IMGno$Iext}"; #change name x pdfname
  300.           $IMGno++;
  301.         }               # postscript env
  302.         if ( $type < 2 ) {
  303.           my $iPST = index($_,"begin{pspicture*}");
  304.           if ($iPST < 0) { $iPST = index($_,"begin{pspicture}"); }      # alternative ...
  305.           if ($iPST < 0) { $iPST = index($_,"\\pspicture"); }   # alternative \endpspicture...
  306.           if ( $iPST >= 0 ) {                           # start Scan
  307.             $ignore = 1;
  308.             $type = 1;
  309.             $depth++;                                   # pspicture env
  310.             LOG("Increase depth: $depth");
  311.             if ( $depth == 0 ) {
  312.               if ($iPST > 1) { print PDF substr($_,0,--$iPST); }# add preceeding text
  313.          #     print PDF "\\IncludeGraphics[scale=$Iscale]{$imageDir/$pdfname-tmp-$IMGno$Iext}"; #change name x pdfname
  314.               print PDF "\\IncludeGraphics[scale=$Iscale]{$pdfname-tmp-$IMGno$Iext}";   # use \graphicspath
  315.               $IMGno++;
  316.               LOG("Increase Image counter: $IMGno");
  317.             }
  318.           }
  319.         }
  320.         if ( !$ignore ) { print PDF "$_"; }                     # default line
  321.         if ( $type == 2 ) {                                     # postscript env
  322.           my $iPS = index($_,"end{postscript}");
  323.           if ($iPS > 0) {
  324.             print PDF substr($_,$iPS+15);                       # rest of line
  325.             $ignore = 0;
  326.             $type=-1;
  327.           }                                                     # end Scan
  328.         } elsif ( $type == 1 ) {                                # pspicture env
  329.           my $iPST = index($_,"end{pspicture*}");
  330.           if ($iPST < 0) { $iPST = index($_,"end{pspicture}"); }# alternative ...
  331.           if ($iPST < 0) { $iPST = index($_,"endpspicture"); }  # alternative \endpspicture...
  332.           if ($iPST > 0) {                                      # end Scan
  333.             if (index($_,"endpspicture") > 0)           # add rest of line, depends to type
  334.                { print PDF substr($_,$iPST+12); }       # \endpspicture
  335.             elsif (index($_,"pspicture*") > 0)
  336.                     { print PDF substr($_,$iPST+15); }  # \end{pspicture*}
  337.             else    { print PDF substr($_,$iPST+14); }  # \end{pspicture}
  338.             $depth--;
  339.             LOG("Decrease depth: $depth");
  340.             if ($depth < 0) { $ignore = 0; }
  341.           }
  342.         }
  343.       } # if ( !$EndDocument )
  344.     } else { print PDF $_; } # if ( $iVerb )
  345.     if (( index($_,"end{verbatim}") > 0 ) or ( index($_,"end{lstlisting}") > 0 )) { $iVerb = 0; }
  346.   } # while (<FILE>)
  347.   close (FILE);
  348.   close (PDF);
  349.   system("pdflatex $tempDir/$pdfname-pdf");    
  350.   system("makeindex $tempDir/$pdfname-pdf.idx");       
  351.   system("bibtex $tempDir/$pdfname-pdf");      
  352.   system("pdflatex $tempDir/$pdfname-pdf");
  353.   if ( $clear ) {
  354.     unlink "$tempDir/$pdfname-pdf.log";
  355.     unlink "$tempDir/$pdfname-pdf.aux";
  356.   }
  357. }
  358.  
  359. sub LOG() {
  360.   if ( $verbose ) { print LOGfile "@_\n"; }
  361. }
  362.  
  363. __END__
  364.  
  365. =head1 NAME
  366.  
  367. B<pst2pdf> - run a TeX source, and convert all PS-related part as single images
  368.     (pdf and/or eps and/or png and/or ...) and then runs pdflatex.
  369.  
  370. =head1 SYNOPSIS
  371.  
  372.   pst2pdf.pl <texfile[,tex]>  [Options]
  373.  
  374. TODO
  375.  
  376. =head1 DESCRIPTION
  377.  
  378. runs latex and pdflatex on the TeX
  379.  
  380. =head1 OPTIONS
  381.  
  382. =over
  383.  
  384. =item --imageDir      - the dir for the created images
  385.  
  386. =item --Iext=<.ext>   - the extension for \includegraphics, can be empty
  387.  
  388. =item --DPI=<int>     - the dots per inch for a cretaed png file
  389.  
  390. =item --Iscale=<real> - the value for \scale= in \includegraphics
  391.  
  392. =item --tempDir=<dir> - temporary directory for the temp files
  393.  
  394. =item --verbose       - long log
  395.  
  396. =item --clear         - delete all temp files
  397.  
  398. =item --noImages      - create no images, build only pdf
  399.  
  400. =back
  401.  
  402. =head1 AUTHORS
  403.  
  404. Herbert Voss <[email protected]>
  405.  
  406. =head1 COPYRIGHT
  407.  
  408. Copyright (c) 2007-2009  Herbert Voss <[email protected]>
  409.  
  410. This program is free software; you can redistribute it and/or modify
  411. it under the terms of the GNU General Public License as published by
  412. the Free Software Foundation; either version 2 of the License, or
  413. (at your option) any later version.
  414.  
  415. This program is distributed in the hope that it will be useful,
  416. but WITHOUT ANY WARRANTY; without even the implied warranty of
  417. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  418. GNU General Public License for more details.
  419.  
  420. You should have received a copy of the GNU General Public License
  421. along with this program; if not, write to the Free Software
  422. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  423.  
Coloreado en 0.013 segundos, usando GeSHi 1.0.8.4
pablgonz
Perlero nuevo
Perlero nuevo
 
Mensajes: 236
Registrado: 2010-09-08 21:03 @919
Ubicación: Concepción (Chile)

Publicidad

Re: Ayuda para agregar -help a script

Notapor explorer » 2010-12-14 17:42 @779

El problema está en la línea 48. Ahí se accede de forma directa al valor de $ARGV[0], que guarda el primer argumento.

El programa espera, como primer argumento, el nombre del fichero TeX a procesar. Siempre.

Así que si llamas al programa con un argumento '-h', ese será el nombre del fichero.

Yo lo que haría sería poner la línea 54 en lugar de la 45, y agregar a GetOptions() el procesamiento de la opción 'h'.
JF^D Perl programming & Raku programming. Grupo en Telegram: https://t.me/Perl_ES
Avatar de Usuario
explorer
Administrador
Administrador
 
Mensajes: 14480
Registrado: 2005-07-24 18:12 @800
Ubicación: Valladolid, España

Re: Ayuda para agregar -help a script

Notapor pablgonz » 2010-12-14 18:49 @825

Lo intenté tal cual me escribes, pero al correr perl pst2pdf me arroja fileparse(): need a valid pathname. Gracias por tu pronta respuesta, seguiré leyendo e intentando.
pablgonz
Perlero nuevo
Perlero nuevo
 
Mensajes: 236
Registrado: 2010-09-08 21:03 @919
Ubicación: Concepción (Chile)

Re: Ayuda para agregar -help a script

Notapor explorer » 2010-12-14 19:06 @837

Claro que da error: hay que modificar el programa para que tenga en cuenta el caso de que el usuario lo haya ejecutado sin darle ningún fichero como argumento.

El procedimiento, según se cuenta en la sección Mixing command line option with other arguments del módulo Getopt::Long es que hay que llamar a GetOptions nada más empezar el programa, y luego, lo que quede en @ARGV, serán el resto de argumentos que el programa necesitará.

En tu caso, se trata del nombre del fichero. PERO, naturalmente, estás pensando de pasarlo de obligatorio (como está ahora) a opcional (si el usuario llama al programa con '-h' es que quiere ver la ayuda del programa, por lo que no pasará ningún fichero).

Ese caso lo tienes que contemplar en el código.
Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
# <= aquí procesamos las opciones con GetOptions

my $fichero;
if (@ARGV) {                 # si aún quedan argumentos...
    $fichero = $ARGV[0];     # leemos el primer argumento como el fichero
}

# <= aquí procesamos las opciones especiales, como el caso de -h, y terminamos el programa

# <= aquí seguimos con la ejecución normal del programa,
# lo primero que debemos comprobar es si el usuario nos ha pasado un fichero o no
if (not $fichero) {
    die "die, die";
}

# resto del programa
Coloreado en 0.001 segundos, usando GeSHi 1.0.8.4
JF^D Perl programming & Raku programming. Grupo en Telegram: https://t.me/Perl_ES
Avatar de Usuario
explorer
Administrador
Administrador
 
Mensajes: 14480
Registrado: 2005-07-24 18:12 @800
Ubicación: Valladolid, España

Re: Ayuda para agregar -help a script

Notapor wanako » 2010-12-15 12:55 @580

Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
  1. eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
  2.   if 0;
  3.  
  4. use strict;                             # to be sure, that all is safe ... :-)
  5.  
  6. # v. 0.10                               simplify the use of PSTricks with pdf
  7. # 2010-01-04    (c) Herbert Voss <[email protected]>
  8. # $Id: pst2pdf.pl 239 2010-01-01 17:23:13Z herbert $
  9. # Thanks to Pablo Gonzales
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or (at
  14. # your option) any later version.
  15. #
  16. # This program is distributed in the hope that it will be useful, but
  17. # WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  19. # See the GNU General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with this program; if not, write to the
  23. # Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. # MA  02111-1307  USA
  25. #
  26. use File::Path;                         # creating/removing dirs
  27. use File::Copy;                         # copying files
  28. use File::Basename;                     # scan argument
  29. use IO::File;                           # simple IO operation
  30. use Getopt::Long;                       # read parameter
  31.  
  32. #----------------------- User part begin ------------------------
  33. my $imageDir = "images";                # where to save the images
  34. my @imageType = ("eps","pdf");          # all image types
  35. push (@imageType, "png") if $^O ne 'MSWin32';
  36. my $Iext = ".pdf";                      # leave empty, if not a special one
  37. my $tempDir = ".";                      # temporary directory
  38. my $verbose = 1;                        # 0 or 1, logfile  
  39. my $clear = 0;                          # 0 or 1, clears all temporary files
  40. my $DPI = 75;                           # very low value for the png's
  41. my $Iscale = 1;                         # for \includegraphics
  42. my $noImages = 0;                       # 1->create no images
  43. my $helpy;                                      # ayuda indefinida :-)
  44. #----------------------- User part end ---------------------------
  45.  
  46. ##@ARGV == 0 && die "file name expected!\n";
  47. if ( !@ARGV ) {
  48.         print "file name expected!\n";
  49.         helpy();                                # un poco mas de ayuda...
  50. }
  51.  
  52. ##              cambiamos el orden, definir las opciones 'antes' de open()
  53. ##              es lo correcto...
  54.  
  55. my $result = GetOptions ("DPI=i"      => \$DPI,         # numeric
  56.                          "Iscale=f"   => \$Iscale,      # real
  57.                          "imageDir=s" => \$imageDir,    # string
  58.                          "tempDir=s"  => \$tempDir,     # string
  59.                          "Iext=s"     => \$Iext,        # string
  60.                          "clear"      => \$clear,       # flag
  61.                          "noImages"   => \$noImages,    # flag
  62.                          "verbose"    => \$verbose,     # flag
  63.                                                  "h|help"         => \$helpy            # ayuda flag
  64.                                                  ) || helpy();                                  # opciones desconocidas y ayuda
  65.  
  66. helpy() if $helpy;              # ayuda si $helpy vale '1' con '-h' o '-help'
  67.  
  68. my @SuffixList = (".tex","",".ltx");                    # possible extensions
  69. my ($name,$path,$ext) = fileparse($ARGV[0],@SuffixList);
  70. if ( $ext eq "" ) { $ext = ".tex"; }                    # me need the extension as well
  71. my $TeXfile = "$path$name$ext";
  72. my $Logfile = "$tempDir/$name.plog";                    # our own log file
  73. open (LOGfile, ">$Logfile") or die "cannot open $Logfile!";
  74.  
  75. LOG ("Parameters:");
  76. LOG ("==> imageDir = $imageDir");
  77. LOG ("==> Iext     = $Iext");
  78. LOG ("==> DPI      = $DPI");
  79. LOG ("==> Iscale   = $Iscale");
  80. LOG ("==> tempDir  = $tempDir");
  81. LOG ("==> verbose  = $verbose");
  82. LOG ("==> clear    = $clear");
  83. LOG ("==> noImages = $noImages");
  84.  
  85. my $imgNo = 0;                          # internal image counter
  86. my $pstExaLoaded = 0;                   # Document loads pst-exa
  87.  
  88. LOG ("Running on [$path][$name][$ext]");
  89. open (FILE, "<$TeXfile") or die "cannot open source file $TeXfile!";    # the source
  90. if ( !$noImages ) {
  91.   if (-d $imageDir) { LOG ("$imageDir exists") }
  92.   else { mkdir("$imageDir", 0744) || die "cannot mkdir $imageDir: $!";
  93.     LOG ("Imagedir created"); }
  94.  
  95.   LOG ("go to savePreamble ... ");
  96.   savePreamble($name);
  97.   LOG ("done!\n go to runFile ...");
  98.   runFile($name);
  99.   LOG ("done!");
  100.   close FILE;                                           # close source file
  101. }# !noImages
  102.  
  103.  
  104. LOG ("runpdfTeX ... ");
  105. runpdfTeX("$path$name",$name);
  106. LOG ("all finished ... :-)");
  107. close LOGfile;
  108. if ( $clear ) {
  109.   unlink "$path$name.aux";
  110.   unlink "$path$name.log";
  111.   unlink "$path$name.preamble";
  112.   unlink "$path$name-tmp.aux";
  113.   unlink "$path$name-tmp.dvi";
  114.   unlink "$path$name-tmp.log";
  115.   unlink "$path$name-tmp.pdf";
  116.   unlink "$path$name-tmp.ps";
  117.   unlink "$path$name-tmp.tex";
  118. }
  119.  
  120. sub savePreamble {                      # create a preamble file
  121. # if we have a \input command inside the preamble, it doesn't hurt, we need
  122. # it anyway for the postscript files and the pdf one.
  123.   my $filename = pop;                   # get the file name
  124.   LOG ("----- Start Preamble -----");
  125.   open (FILEp, ">$tempDir/$filename.preamble")
  126.     or die "cannot open preamble file $tempDir/$filename.preamble!";
  127.   while (<FILE>) {                      # read all until \begin{document}
  128.     $pstExaLoaded = index($_,"usepackage{pst-exa}");
  129.     my $i = index($_,"begin{document}");
  130.     if ($i > 0) {
  131.       if ($i > 1) { print FILEp substr($_,0,--$i); }    # write all until \begin{document}
  132.       print FILEp "\n\\usepackage{pst-exa}\n";
  133.       close(FILEp);                                     # close preamble
  134.       LOG ("----- Close Preamble ------");
  135.       return;
  136.     } else {
  137.       print FILEp "$_";                                 # write into preamble
  138.       LOG ("$_");
  139.     }
  140.   }
  141.   close(FILEp);
  142.   if ( $verbose ) { LOG("<-----Preamble<----"); }
  143.   return;
  144. }
  145.  
  146. sub searchPS {                                  # search the PostScript parts
  147.   my @PS = ();                                  # single PS sequence
  148.   my @PStotal = ();                             # all PS sequences as list of arrays
  149.   my $depth = -1;                               # counts nested macros
  150.   my $type = -1;                                # -1-> none; 1->PST; 2->PS;
  151.   my $EndDocument = 0;                          # ignore all after \end{document}
  152.   my $iVerb = 0;                                # test for verbatim or lstlisting environment, must be ignored
  153.   while (<FILE>) {                              # scan the input file
  154.     if (!$EndDocument) {
  155.     chomp;                                      # delete EOL character
  156.     my $line = $_;                              # save line
  157.     if ( !$iVerb ) {
  158.       $iVerb = ((index($line,"begin{verbatim}") > 0) or (index($line,"begin{lstlisting}") > 0));
  159.     }                                           # do nothing until \end{verbatim}
  160.     if ( !$iVerb ) {
  161.       my $iPS = index($line,"begin{postscript}");
  162.       my $iPST = index($line,"begin{pspicture*}");
  163.       if ($iPST < 0) { $iPST = index($line,"begin{pspicture}"); }       # alternative
  164.       if ($iPST < 0) { $iPST = index($line,"pspicture"); }      # alternative \pspicture...
  165.       if (($iPS > 0) && ( $type == 1 )){ print "postscript environment must be of outer level!\n"; exit 1; }
  166.       if ( $type < 0 ) {                        # no active environment
  167.         if ($iPS > 0) {                         # we have \begin{postscript}
  168.           $type = 2;                   
  169.           $line = substr($line,$iPS-1);         # add rest of the line
  170.           LOG("PS-Zeile: $line");
  171.         }                              
  172.         elsif ( $iPST > 0 ) {                   # we have \begin{pspicture} or \pspicture
  173.           $type = 1;
  174.           $depth++;  
  175.           $line = substr($line,$iPST-1);        # add all unitl pspicture
  176.           LOG("PST-Zeile: $line");
  177.         }
  178.       }
  179. #       we have now \begin{pspicture} or \begin{postscript}
  180.       if ($type > 0) {                          # start Scan, we have an environment
  181.         LOG ("searchPS: set \$type=$type");
  182.         $iPST = index($line,"end{pspicture*}");
  183.         if ($iPST < 0) { $iPST = index($line,"end{pspicture}"); }       # alternative
  184.         if ($iPST < 0) { $iPST = index($line,"endpspicture"); } # alternative \endpspicture...
  185.         $iPS = index($line,"end{postscript}"); 
  186.         if ($iPST > 0) {                        # test, we can have postscript and pspicture in one line
  187.           if ( $type < 2) {                     # found end of pspicture environment
  188.             LOG ("searchPS: $line");
  189.             $depth--;
  190.             if ($depth < 0) {
  191.               $type = -1;
  192.               if (index($line,"endpspicture") > 0)              # add line, depends to type
  193.                    { push @PS,substr($line,0,$iPST+12); }       # \endpspicture
  194.               elsif (index($line,"pspicture*") > 0)
  195.                       { push @PS,substr($line,0,$iPST+15); }    # \end{pspicture}
  196.               else { push @PS,substr($line,0,$iPST+14); }       # \end{pspicture}
  197.               LOG ("searchPS: set \$type=$type");
  198.               push @PStotal,[@PS];      # add PS sequence
  199.               LOG ("---->PS---->\n@PS\n<----PS<----");
  200.               @PS = ();                 # start new PS sequence
  201.             }                           # no pspicture env left
  202.           } else { push @PS,$line; }    # pspicture inside postscript
  203.         } elsif ($iPS > 0) {            # must be type=1 -> stop Scan
  204.           LOG ("searchPS: $line");
  205.           $type = -1;
  206.           push @PS,substr($line,0,$iPS+15);# add line
  207.           LOG ("searchPS: set \$type=$type");
  208.           push @PStotal,[@PS];          # add PS sequence
  209.           LOG ("---->PS---->\n@PS\n<----PS<----");
  210.           @PS = ();                     # start new PS sequence
  211.         } else { push @PS,$line; }              # add line
  212.       }
  213.       my $i = index($line,"end{document}");
  214.       if ($i > 0) { $EndDocument++; LOG("EndDocument in searchPS"); }
  215.     } # if ( $iVerb )
  216.     if (( index($line,"end{verbatim}") > 0 ) or ( index($line,"end{lstlisting}") > 0 )) { $iVerb = 0; }
  217.   }}
  218.   if ( $verbose ) {
  219.     LOG("---->PStotal---->");
  220.     for my $aref ( @PStotal ) {
  221.       my @a = @$aref;
  222.       my $i = 0;
  223.       foreach ( @a ) { LOG ($a[$i]); $i++; }
  224.     }
  225.     LOG ("<----PStotal<----");
  226.   }
  227.   close(FILE);
  228.   return @PStotal;                      # return all PS sequences
  229. }
  230.  
  231. sub runTeX {
  232.   my $filename = pop;
  233.   system("latex $filename"); # or die "Error in the LaTeX run from file $filename!";
  234.   system("dvips $filename"); # or die "Error in the dvips run from file $filename!";
  235.   system("ps2pdf $filename.ps");# or die "Error in the ps2pdf run from file $filename!";
  236.   copy("$filename.tex", "$imageDir/$filename-$imgNo.tex") or die "Cannot copy Source file!";;
  237.   for my $Itype ( @imageType ) {
  238.     if ($Itype eq "pdf") { system("pdfcrop $filename.pdf $imageDir/$filename-$imgNo.pdf");  }
  239.     if ($Itype eq "png") {
  240.       system("pdftoppm -f 1 -l 1 -r $DPI $imageDir/$filename-$imgNo.pdf $imageDir/");
  241.       system("convert $imageDir/-1.ppm  $imageDir/$filename-$imgNo.png");
  242.       system("rm $imageDir/-1.ppm");
  243.     }
  244.     if ($Itype eq "eps") { system("pdftops -f 1 -l 1 -eps $imageDir/$filename-$imgNo.pdf $imageDir/$filename-$imgNo.eps"); }
  245.   }
  246.   $imgNo++;
  247. }
  248.  
  249. sub runFile {
  250.   my $filename = pop;
  251.   my @PSarray = searchPS();
  252.   if ( $verbose ) {
  253.     LOG("---->PSarray---->");
  254.     for my $aref ( @PSarray ) {
  255.       my @a = @$aref;
  256.       my $i = 0;
  257.       foreach ( @a ) { print LOG $a[$i]."\n"; $i++; }
  258.     }
  259.     LOG("<----PSarray<----");
  260.     my $no = @PSarray;
  261.     LOG("PS: ".$no." PS sequence(s)");
  262.   }
  263.   for my $aref ( @PSarray ) {
  264.     my @PS = @$aref;
  265.     open (FILEp, "<$tempDir/$filename.preamble") or die "cannot open $tempDir/$filename.preamble!";
  266.     open (FILEsub, ">$tempDir/$filename-tmp.tex") or die "cannot open $tempDir/$filename-tmp.tex!";
  267. #    print FILEsub "\\RequirePackage{listings}\n";
  268.     while (<FILEp>) { print FILEsub $_; }
  269.     print FILEsub "\\pagestyle{empty}\n";
  270.     print FILEsub "\\newenvironment{postscript}{}{}\n";
  271.     print FILEsub "\\providecommand\\IncludeGraphics[2][]{}\n";
  272.     print FILEsub "\\begin{document}\n";
  273.     if ( $verbose ) { LOG("\@PS: $_"); }
  274.     foreach ( @PS ) { print FILEsub "$_\n"; }
  275.     print FILEsub "\\end{document}\n";
  276.     close (FILEsub);
  277.     close (FILEp);
  278.     runTeX("$tempDir/$filename-tmp");
  279.   }
  280. }
  281.  
  282. sub runpdfTeX() {
  283.   my ($name,$pdfname) = @_;
  284.   open (PDF, ">$tempDir/$pdfname-pdf.tex") or die "cannot open $tempDir/$pdfname-pdf.tex!";
  285.   open (FILE, "<$name.tex") or die "cannot open $name!";
  286.   print PDF "\\RequirePackage{graphicx}\n";
  287. #  if ($pstExaLoaded < 1) {
  288. #    print PDF "\\AtBeginDocument{\\let\\IncludeGraphics\\includegraphics}\n"; }
  289. #  print PDF "\\setkeys{Gin}{scale=0.25}\n";
  290. #  print PDF "\\providecommand\\psset[1]{}\n";
  291.   print PDF "\\graphicspath{{$imageDir/}}\n"; #uncomment
  292.   my $ignore = 0;
  293.   my $IMGno = 0;
  294.   my $depth = -1;
  295.   my $type = -1;
  296.   my $EndDocument = 0;                  # ignore all after \end{document}
  297.   my $iVerb = 0;
  298.   while (<FILE>) {                      # scan the input file
  299.     if ( !$iVerb ) {
  300.       $iVerb = ((index($_,"begin{verbatim}") > 0) or (index($_,"begin{lstlisting}") > 0));
  301.     } # do nothing until \end{verbatim}|| \end{lstlisting}
  302.     if ( !$iVerb ) {
  303.       my $i = index($_,"end{document}");
  304.       if ($i > 0) { print PDF $_; $EndDocument++; LOG("EndDocument in runpdfTeX"); }
  305.       if ( !$EndDocument ) {
  306.         my $iPS = index($_,"begin{postscript}");
  307.         if ( $iPS > 0 ) {
  308.           $type = 2;
  309.           $ignore = 1;
  310.           if ($iPS > 1) { print PDF substr($_,0,--$iPS); }      # add preceeding text
  311.          print PDF "\\IncludeGraphics[scale=$Iscale]{$pdfname-tmp-$IMGno$Iext}"; #change name x pdfname
  312.           $IMGno++;
  313.         }               # postscript env
  314.         if ( $type < 2 ) {
  315.           my $iPST = index($_,"begin{pspicture*}");
  316.           if ($iPST < 0) { $iPST = index($_,"begin{pspicture}"); }      # alternative ...
  317.           if ($iPST < 0) { $iPST = index($_,"\\pspicture"); }   # alternative \endpspicture...
  318.           if ( $iPST >= 0 ) {                           # start Scan
  319.             $ignore = 1;
  320.             $type = 1;
  321.             $depth++;                                   # pspicture env
  322.             LOG("Increase depth: $depth");
  323.             if ( $depth == 0 ) {
  324.               if ($iPST > 1) { print PDF substr($_,0,--$iPST); }# add preceeding text
  325.          #     print PDF "\\IncludeGraphics[scale=$Iscale]{$imageDir/$pdfname-tmp-$IMGno$Iext}"; #change name x pdfname
  326.               print PDF "\\IncludeGraphics[scale=$Iscale]{$pdfname-tmp-$IMGno$Iext}";   # use \graphicspath
  327.               $IMGno++;
  328.               LOG("Increase Image counter: $IMGno");
  329.             }
  330.           }
  331.         }
  332.         if ( !$ignore ) { print PDF "$_"; }                     # default line
  333.         if ( $type == 2 ) {                                     # postscript env
  334.           my $iPS = index($_,"end{postscript}");
  335.           if ($iPS > 0) {
  336.             print PDF substr($_,$iPS+15);                       # rest of line
  337.             $ignore = 0;
  338.             $type=-1;
  339.           }                                                     # end Scan
  340.         } elsif ( $type == 1 ) {                                # pspicture env
  341.           my $iPST = index($_,"end{pspicture*}");
  342.           if ($iPST < 0) { $iPST = index($_,"end{pspicture}"); }# alternative ...
  343.           if ($iPST < 0) { $iPST = index($_,"endpspicture"); }  # alternative \endpspicture...
  344.           if ($iPST > 0) {                                      # end Scan
  345.             if (index($_,"endpspicture") > 0)           # add rest of line, depends to type
  346.                { print PDF substr($_,$iPST+12); }       # \endpspicture
  347.             elsif (index($_,"pspicture*") > 0)
  348.                     { print PDF substr($_,$iPST+15); }  # \end{pspicture*}
  349.             else    { print PDF substr($_,$iPST+14); }  # \end{pspicture}
  350.             $depth--;
  351.             LOG("Decrease depth: $depth");
  352.             if ($depth < 0) { $ignore = 0; }
  353.           }
  354.         }
  355.       } # if ( !$EndDocument )
  356.     } else { print PDF $_; } # if ( $iVerb )
  357.     if (( index($_,"end{verbatim}") > 0 ) or ( index($_,"end{lstlisting}") > 0 )) { $iVerb = 0; }
  358.   } # while (<FILE>)
  359.   close (FILE);
  360.   close (PDF);
  361.   system("pdflatex $tempDir/$pdfname-pdf");    
  362.   system("makeindex $tempDir/$pdfname-pdf.idx");       
  363.   system("bibtex $tempDir/$pdfname-pdf");      
  364.   system("pdflatex $tempDir/$pdfname-pdf");
  365.   if ( $clear ) {
  366.     unlink "$tempDir/$pdfname-pdf.log";
  367.     unlink "$tempDir/$pdfname-pdf.aux";
  368.   }
  369. }
  370.  
  371. sub LOG() {
  372.   if ( $verbose ) { print LOGfile "@_\n"; }
  373. }
  374.  
  375. sub helpy {                     # funcion ayudita
  376.         die <<'FIN';    # buscar 'here documents' en Perl...
  377.  
  378.         Help, I need somebody
  379.         Help, not just anybody
  380.         Help, you know I need someone, help
  381. FIN
  382. }
  383. __END__
  384.  
  385. =head1 NAME
  386.  
  387. B<pst2pdf> - run a TeX source, and convert all PS-related part as single images
  388.     (pdf and/or eps and/or png and/or ...) and then runs pdflatex.
  389.  
  390. =head1 SYNOPSIS
  391.  
  392.   pst2pdf.pl <texfile[,tex]>  [Options]
  393.  
  394. TODO
  395.  
  396. =head1 DESCRIPTION
  397.  
  398. runs latex and pdflatex on the TeX
  399.  
  400. =head1 OPTIONS
  401.  
  402. =over
  403.  
  404. =item --imageDir      - the dir for the created images
  405.  
  406. =item --Iext=<.ext>   - the extension for \includegraphics, can be empty
  407.  
  408. =item --DPI=<int>     - the dots per inch for a cretaed png file
  409.  
  410. =item --Iscale=<real> - the value for \scale= in \includegraphics
  411.  
  412. =item --tempDir=<dir> - temporary directory for the temp files
  413.  
  414. =item --verbose       - long log
  415.  
  416. =item --clear         - delete all temp files
  417.  
  418. =item --noImages      - create no images, build only pdf
  419.  
  420. =back
  421.  
  422. =head1 AUTHORS
  423.  
  424. Herbert Voss <[email protected]>
  425.  
  426. =head1 COPYRIGHT
  427.  
  428. Copyright (c) 2007-2009  Herbert Voss <[email protected]>
  429.  
  430. This program is free software; you can redistribute it and/or modify
  431. it under the terms of the GNU General Public License as published by
  432. the Free Software Foundation; either version 2 of the License, or
  433. (at your option) any later version.
  434.  
  435. This program is distributed in the hope that it will be useful,
  436. but WITHOUT ANY WARRANTY; without even the implied warranty of
  437. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  438. GNU General Public License for more details.
  439.  
  440. You should have received a copy of the GNU General Public License
  441. along with this program; if not, write to the Free Software
  442. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  443.  
Coloreado en 0.012 segundos, usando GeSHi 1.0.8.4


Y como dice explorer, no verifica si 'existe' el fichero antes de abrirlo, por eso crea los 'LOGs' inutilmente, agregar Pod::Usage es similar a lo que hice, puedes mejorarlo ;-)

PD: las caritas 'smiles' y los tabs se traducen aún usando etiquetas perl code, queda feito pero se entiende.
wanako
Perlero nuevo
Perlero nuevo
 
Mensajes: 27
Registrado: 2010-09-23 11:27 @519

Re: Ayuda para agregar -help a script

Notapor explorer » 2010-12-15 13:26 @601

Las caritas sonrientes se pueden deshabilitar debajo de la caja de edición de texto de cada mensaje, en la opción que se llama "Deshabilitar emoticonos".

Y los tabuladores se arreglan reduciéndolos o cambiándolos por espacios...
JF^D Perl programming & Raku programming. Grupo en Telegram: https://t.me/Perl_ES
Avatar de Usuario
explorer
Administrador
Administrador
 
Mensajes: 14480
Registrado: 2005-07-24 18:12 @800
Ubicación: Valladolid, España


Volver a Básico

¿Quién está conectado?

Usuarios navegando por este Foro: Google [Bot] y 21 invitados

cron