Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 74A1E429E21 for ; Tue, 15 Nov 2011 08:11:28 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ft1J6ebCJLhy for ; Tue, 15 Nov 2011 08:11:21 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id DDF08431FB6 for ; Tue, 15 Nov 2011 08:11:20 -0800 (PST) Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31]) by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pAFGBGuC011967 for ; Tue, 15 Nov 2011 18:11:18 +0200 From: Tomi Ollila To: Subject: [RFC PATCH] nmbug help w/o perldoc User-Agent: Notmuch/0.9+73~ged20210 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 16:11:28 -0000 --- notmuch help runs pod2usage with -verbose => 2, which by default tries to run perldoc. Adding -noperldoc => 1 disables this use but there is no pre-verifying interface (or so) available. In one of my systems there was no 'perldoc' script, which basically contains: use Pod::PerlDoc; exit( Pod::Perldoc->run() ); However, the system has Pod/Perldoc.pm installed. This patch demonstraces how Perldoc.pm can be used directly from perl program. This is probably not the best way, but 'man Perldoc' does not mention any other way to use the module. If you have problems running 'notmuch help' (it prints contents of the command instead of help) and/or are otherwise interested the problem look this patch and if you have ideas/knowledge how to improve it please reply to this e-mail. contrib/nmbug | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/nmbug b/contrib/nmbug index bb0739f..343fe10 100755 --- a/contrib/nmbug +++ b/contrib/nmbug @@ -5,7 +5,6 @@ use strict; use warnings; use File::Temp qw(tempdir); -use Pod::Usage; no encoding; @@ -467,14 +466,16 @@ sub decode_from_fs { sub usage { - pod2usage (); + require Pod::Usage; + Pod::Usage::pod2usage (); exit (1); } sub do_help { - pod2usage ( -verbose => 2 ); - exit (0); + require Pod::Perldoc; + @ARGV = ( $0 ); + exit ( Pod::Perldoc->run() ); } __END__ -- 1.7.7.3