あるタイミング(たぶんrubyのバージョンが1.8.6から1.8.7に上がったとき)からrdtoolの--with-partが動かなくなっているのに気づいていたものの放置していたのですが、入っているrubyが全部新しくなってしまったのでちょっと調べてみました。
どうやら、optparseの仕様が変わったのが原因のようで、/usr/bin/rd2に以下のパッチを当てると使えるようになります。
Index: rd2
===================================================================
--- rd2.orig 2009-11-08 15:19:04.351061300 +0900
+++ rd2 2009-11-08 15:16:25.176116400 +0900
@@ -130,7 +130,7 @@
# accept "PART:FILTER" and "PART"
q.on("--with-part=PART",
/(\w+)(?:\s*:\s*(\w+))?/,
- "include PART with Filter") do |src, part, filter|
+ "include PART with Filter") do |part, filter|
with_part.push([part, filter || part])
unless include_path.index(RD::RDTree.tmp_dir)
include_path.push(RD::RDTree.tmp_dir)
ちなみに環境はこんな感じです。
$ ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin] $ rd2 --version RDtool -- rd2 0.6.21 RDtool Framework -- Document Tree 0.6.21 RDtool Framework -- Visitor 0.6.21
ちなみに、[ruby-list:45645] rdtool cannot handle filterに別のパッチがあります(こっちのほうがapiの使い方としては正しそう)。
rd2 ignores --with-part option.も参考にしました。