From 29edb8f84852f3bd5bdb1c859bc469f209262d27 Mon Sep 17 00:00:00 2001 From: "claus.reinke@talk21.com" Date: Thu, 1 May 2008 15:27:00 +0000 Subject: [PATCH] Document ghc-pkg find-module, substring matching, and multi-field selection Documentation and examples taken from - ghc-pkg/Main.hs usageHeader - patch: FIX 1463 (implement 'ghc-pkg find-module') - patch: FIX #1839, #1463, by supporting ghc-pkg bulk queries with substring matching --- docs/users_guide/packages.xml | 52 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/packages.xml b/docs/users_guide/packages.xml index b37e266..8f8f880 100644 --- a/docs/users_guide/packages.xml +++ b/docs/users_guide/packages.xml @@ -578,6 +578,26 @@ $ export GHC_PACKAGE_PATH=$HOME/.my-ghc-packages.conf: + ghc-pkg find-module M [] + + This option lists registered packages exposing module + M. Examples: + +$ ghc-pkg find-module Var +c:/fptools/validate/ghc/driver/package.conf.inplace: + (ghc-6.9.20080428) + +$ ghc-pkg find-module Data.Sequence +c:/fptools/validate/ghc/driver/package.conf.inplace: + containers-0.1 + + Otherwise, it behaves like ghc-pkg list, + including options. + + + + + ghc-pkg latest P Prints the latest available version of package @@ -597,14 +617,42 @@ $ export GHC_PACKAGE_PATH=$HOME/.my-ghc-packages.conf: - ghc-pkg field P field + ghc-pkg field P field[,field]* Show just a single field of the installed package description - for P. + for P. Multiple fields can be selected by separating + them with commas + + Substring matching is supported for M in + find-module and for P in + list, describe, and + field, where a '*' indicates open + substring ends (prefix*, *suffix, + *infix*). Examples (output omitted): + + + -- list all regex-related packages + ghc-pkg list '*regex*' --ignore-case + -- list all string-related packages + ghc-pkg list '*string*' --ignore-case + -- list OpenGL-related packages + ghc-pkg list '*gl*' --ignore-case + -- list packages exporting modules in the Data hierarchy + ghc-pkg find-module 'Data.*' + -- list packages exporting Monad modules + ghc-pkg find-module '*Monad*' + -- list names and maintainers for all packages + ghc-pkg field '*' name,maintainer + -- list location of haddock htmls for all packages + ghc-pkg field '*' haddock-html + -- dump the whole database + ghc-pkg describe '*' + + Additionally, the following flags are accepted by ghc-pkg: -- 1.7.10.4