Changeset 4451:2eb8cce037b3 in livinglogic.python.xist

Show
Ignore:
Timestamp:
04/05/11 18:04:14 (8 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Docstring for orafind.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/orasql/scripts/orafind.py

    r4422 r4451  
    1010 
    1111 
     12""" 
     13Purpose 
     14------- 
     15 
     16``orafind`` can be used to search all tables in an Oracle database schema for 
     17a string. 
     18 
     19 
     20Options 
     21------- 
     22 
     23``orafind`` supports the following options: 
     24 
     25    ``connectstring`` 
     26        An Oracle connectstring. 
     27 
     28    ``searchstring`` 
     29        The text to be searched for. 
     30 
     31    ``tables`` 
     32        Zero or more tables names. If any table name is specified the search will 
     33        be limited to those tables. Otherwise all tables will be searched. 
     34         
     35    ``-v``, ``--verbose`` : ``false``, ``no``, ``0``, ``true``, ``yes`` or ``1`` 
     36        Produces output (on stderr) while to datebase is read or written. 
     37 
     38    ``-c``, ``--color`` : ``yes``, ``no`` or ``auto`` 
     39        Should the output (when the ``-v`` option is used) be colored. If ``auto`` 
     40        is specified (the default) then the output is colored if stderr is a 
     41        terminal. 
     42 
     43    ``-i``, ``--ignore-case`` : ``false``, ``no``, ``0``, ``true``, ``yes`` or ``1`` 
     44        If given, the search will be case insensitve. 
     45 
     46    ``-r``, ``--read-lobs`` : ``false``, ``no``, ``0``, ``true``, ``yes`` or ``1`` 
     47        If given, ``CLOB``\s will be read when printing search results. 
     48 
     49    ``-e``, ``--encoding`` : encoding 
     50        The encoding of the command line arguments (default is ``utf-8``). 
     51 
     52Example 
     53------- 
     54 
     55Search for ``spam`` in all tables in the schema ``user@db``. The search is case 
     56insensitive and ``CLOB``\s will be printed:: 
     57 
     58    $ orafind user/pwd@db spam -i -r 
     59""" 
     60 
     61 
    1262import sys, os, argparse 
    1363 
    1464from ll import misc, orasql, astyle 
     65 
     66 
     67__docformat__ = "reStructuredText" 
    1568 
    1669 
     
    96149    p.add_argument("-c", "--color", dest="color", help="Color output (default: %(default)s)", default="auto", choices=("yes", "no", "auto")) 
    97150    p.add_argument("-i", "--ignore-case", dest="ignorecase", help="Ignore case distinctions? (default: %(default)s)", action=misc.FlagAction, default=False) 
    98     p.add_argument("-r", "--read-lobs", dest="readlobs", help="Read LOBs when printing records? (default: %(default)s)", action=misc.FlagAction, default=False) 
     151    p.add_argument("-r", "--read-lobs", dest="readlobs", help="Read CLOBs when printing records? (default: %(default)s)", action=misc.FlagAction, default=False) 
    99152    p.add_argument("-e", "--encoding", dest="encoding", help="Encoding of the command line arguments (default: %(default)s)", default="utf-8") 
    100153