[ttssh2-commit] [9800] 処理しているファイルを表示できるようにした

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2022年 3月 10日 (木) 00:55:52 JST


Revision: 9800
          https://osdn.net/projects/ttssh2/scm/svn/commits/9800
Author:   zmatsuo
Date:     2022-03-10 00:55:52 +0900 (Thu, 10 Mar 2022)
Log Message:
-----------
処理しているファイルを表示できるようにした

- htmlhelp_index_make.pl
- --verbose オプションを追加
- 標準出力に出力しないようにした
  - すべて --output 指定したファイルへ出力するようにした
- 不要コード削除

Modified Paths:
--------------
    trunk/doc/htmlhelp_index_make.pl
    trunk/doc/makechm.bat

-------------- next part --------------
Modified: trunk/doc/htmlhelp_index_make.pl
===================================================================
--- trunk/doc/htmlhelp_index_make.pl	2022-03-09 15:50:10 UTC (rev 9799)
+++ trunk/doc/htmlhelp_index_make.pl	2022-03-09 15:55:52 UTC (rev 9800)
@@ -3,8 +3,8 @@
 #
 # HTMLヘルプのインデックスファイルを生成する
 #
-# Usage(ActivePerl):
-#  perl htmlhelp_index_make.pl ja html > ja\Index.hhk
+# Usage:
+#  perl htmlhelp_index_make.pl ja html -o ja\Index.hhk
 #
 
 require 5.8.0;
@@ -16,17 +16,15 @@
 
 binmode STDOUT, ":utf8";
 
-my $out = "-";
+my $out = "index.hhk";
+my $verbose = 0;
 my $result = GetOptions(
-	'out|o=s' => \$out);
+	'out|o=s' => \$out,
+	'verbose' => \$verbose
+	);
 
 my $OUT;
-if ($out eq "-") {
-	binmode STDOUT, ":crlf:encoding(shiftjis)";
-	$OUT = *STDOUT;
-} else {
-	open ($OUT, '>:crlf:encoding(shiftjis)', $out);
-}
+open ($OUT, '>:crlf:encoding(shiftjis)', $out);
 
 my @dirstack = ();
 
@@ -62,7 +60,6 @@
 
 sub get_file_paths {
 	my ($top_dir)= @_;
-	my @paths=();
 	my @temp = ();
 
 	#-- カレントの一覧を取得 --#
@@ -71,12 +68,13 @@
 	closedir(DIR);
 	foreach my $path (sort @temp) {
 		next if( $path =~ /^\.{1,2}$/ );                # '.' と '..' はスキップ
-		next if( $path =~ /^\.svn$/ );                # '.svn' はスキップ
+		next if( $path =~ /^\.svn$/ );                  # '.svn' はスキップ
 
 		my $full_path = "$top_dir" . '/' . "$path";
 
-#		print "$full_path\r\n";                     # 表示だけなら全てを表示してくれる-------
-		push(@paths, $full_path);                       # データとして取り込んでも前の取り込みが初期化される
+		if ($verbose != 0) {
+			print "$full_path\r\n";
+		}
 		if( -d "$top_dir/$path" ){                      #-- ディレクトリの場合は自分自身を呼び出す
 			&get_file_paths("$full_path");
 
@@ -85,7 +83,6 @@
 
 		}
 	}
-	return \@paths;
 }
 
 sub check_html_file {

Modified: trunk/doc/makechm.bat
===================================================================
--- trunk/doc/makechm.bat	2022-03-09 15:50:10 UTC (rev 9799)
+++ trunk/doc/makechm.bat	2022-03-09 15:55:52 UTC (rev 9800)
@@ -20,7 +20,7 @@
 
 for /f "delims=" %%i in ('perl htmlhelp_update_check.pl ja teratermj.chm') do @set updated=%%i
 if "%updated%"=="updated" (
-perl htmlhelp_index_make.pl ja html > ja\Index.hhk
+perl htmlhelp_index_make.pl ja html -o ja\Index.hhk
 %HELP_COMPILER% ja\teraterm.hhp
 )
 
@@ -27,6 +27,6 @@
 :English
 for /f "delims=" %%i in ('perl htmlhelp_update_check.pl en teraterm.chm') do @set updated=%%i
 if "%updated%"=="updated" (
-perl htmlhelp_index_make.pl en html > en\Index.hhk
+perl htmlhelp_index_make.pl en html -o en\Index.hhk
 %HELP_COMPILER% en\teraterm.hhp
 )


ttssh2-commit メーリングリストの案内
Back to archive index