Annotation of doc/help/course_manual/buildTexxml.pl, revision 1.2
1.1 felicia 1: #!/usr/bin/perl
1.2 ! albertel 2: use strict;
1.1 felicia 3:
4: if ($#ARGV != 0) {
1.2 ! albertel 5: print("Correct command usage: \n");
! 6: print(" perl buildTexxml.pl all\n");
! 7: print("Or \n");
! 8: print(" perl buildTexxml.pl section\n");
1.1 felicia 9: }
10:
1.2 ! albertel 11: my $option = $ARGV[0];
1.1 felicia 12:
1.2 ! albertel 13: my @section = `cat section_order.txt`;
! 14: chomp(@section);
1.1 felicia 15:
1.2 ! albertel 16: if ($option eq 'all') {
! 17: my $section_list;
! 18: foreach my $section (@section) {
! 19: $section_list .= 'sections/'.$section.' ';
! 20: }
! 21: system("cat sections/start.texxml $section_list sections/end.texxml > course.manual.texxml");
1.1 felicia 22: }
23:
1.2 ! albertel 24: if ($option eq 'section') {
! 25: print("Choose from the following manual sections:\n");
! 26: my $num=0;
! 27: foreach my $section (@section) {
! 28: print("$num - $section\n");
! 29: $num++;
! 30: }
! 31: $num--;
! 32:
! 33: print("Enter a number 0 - $num for the section you want to print: ");
! 34: my $selection=<STDIN>;
! 35: chomp($selection);
! 36:
! 37: if ($selection < 0 || $selection > $#section) {
! 38: print("Invalid selection ($selection)\n");
! 39: exit(1);
! 40: }
! 41: print("builing section $section[$selection]\n");
! 42: system("cat sections/start.texxml sections/$section[$selection] sections/end.texxml > section.manual.texxml");
1.1 felicia 43: }
44:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>