summaryrefslogtreecommitdiff
path: root/syntax.pl
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-07-26 17:52:19 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-07-26 17:52:19 +0000
commitd9f9b64c76105977fccabd7e99dc1f6cef970de3 (patch)
tree34736d1d41734bcfc00e518b237ec050566c093f /syntax.pl
parent1fe6d11d7e628d94ebafaeb5eefa37457e44a0d6 (diff)
downloadirssi-d9f9b64c76105977fccabd7e99dc1f6cef970de3.zip
Help files by lite
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@536 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'syntax.pl')
-rwxr-xr-xsyntax.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/syntax.pl b/syntax.pl
new file mode 100755
index 00000000..af5a2b41
--- /dev/null
+++ b/syntax.pl
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+#
+# This script reads the syntaces of commands from irssi source tree.
+# Then it browses through all '.in' files in the current directory and
+# substitutes '@SYNTAX:foo@' tags with real syntaces found. This data
+# is written into the corresponding files without the '.in' extension.
+# For example: help.in -> ../help
+#
+# This path has to be changed. It should point to your irssi/src directory
+# Remember to include the asterisk ('*').
+$SRC_PATH='src/*';
+
+# This is quick and dirty, but works for sure :)
+$FOO = `grep -r -e '/* SYNTAX:' $SRC_PATH | sed 's/.*SYNTAX: //' > irssi_syntax`;
+while (<docs/help/in/*.in>) {
+ open (FILE, "$_");
+ @data = <FILE>;
+ close (FILE);
+ foreach $DATARIVI (@data) {
+ if ($DATARIVI =~ /\@SYNTAX\:(.+)\@/) {
+ $etsittava = "\U$1 ";
+ $SYNTAX = `grep \'^$etsittava\' irssi_syntax`;
+ $SYNTAX =~ s/\*\///g; $SYNTAX =~ s/ *$//;
+ $DATARIVI = $SYNTAX;
+ }
+ }
+ $newfilename = $_; $newfilename =~ s/\.in$//;
+ $newfilename =~ s/\/in\//\//;
+ open (NEWFILE, ">$newfilename");
+ print NEWFILE @data;
+ close (NEWFILE);
+}