Commits

Jussi Judin  committed 4a19efd

Documentation update.

  • Participants
  • Parent commits 16939b2

Comments (0)

Files changed (2)

 
 .. _libguess: http://www.atheme.org/project/libguess
 
+You can also use this as a regular command line program by giving
+region as the first parameter and possible target files after that::
+
+  Usage: python guess.py region [input_file...]
+
+  If input file name is not given, this program reads from the standard input.
+
+  Use '-' to use standard input as input file.
+
 Functions
 =========
 
 different encodings (UTF-8, SHIFT-JIS, EUC-JP) and libguess will
 hopefully guess the encoding correctly just by looking at the first
 few bytes of the given string.
+
+You can also use this as a regular command line program by giving
+region as the first parameter and possible target files after that:
+
+  Usage: python %s region [input_file...]
+
+  If input file name is not given, this program reads from the standard input.
+
+  Use '-' to use standard input as input file.
 """
+__doc__ = __doc__ % __file__
 
 import ctypes
 import optparse
     for given region or None if error happened.
 
     As an usage example we might see what happens when given Japanese
-    text in 2 different encodings::
+    text in 2 different encodings:
 
     >>> import guess
     >>> guess.determine_encoding(u'\u3042'.encode('euc-jp'), guess.REGION_JP)
 
     The output string of this function can be given directly
     to iconv_open() C function and the resulting names should be
-    compatible with the encoding string of str.decode() function::
+    compatible with the encoding string of str.decode() function:
 
     >>> encoded_value = u'\u3042'.encode('shift-jis')
     >>> encoding = guess.determine_encoding(encoded_value, guess.REGION_JP)
 
     In case the given region name is invalid or the underlying
     libguess_determine_encoding() call fails for any other reason,
-    None value is returned::
+    None value is returned:
 
     >>> encoding = guess.determine_encoding("asdf", "UNKNOWN")
     >>> encoding is None
 def _main(argv=sys.argv):
     usage = """%prog region [input_file...]
 
-If input file name is not given, this program reads from standard input.
+If input file name is not given, this program reads from the standard input.
 
 Use '-' to use standard input as input file."""
     parser = optparse.OptionParser(usage=usage,