Better help messages

This commit is contained in:
Johann Dreo 2014-02-10 21:16:28 +01:00
commit 488c2a2f88

View file

@ -695,7 +695,7 @@ def __args_parse__(argv, usage=""):
parser.add_argument("pattern", metavar="REGEX", type=str, nargs=1, parser.add_argument("pattern", metavar="REGEX", type=str, nargs=1,
help="A regular expression") help="A regular expression")
pygments_warn=" You can also use a language name to activate syntax coloring (see `-r all` for a list)." pygments_warn=" You can use a language name to activate syntax coloring (see `-r all` for a list)."
try: try:
import pygments import pygments
except ImportError: except ImportError:
@ -705,14 +705,14 @@ def __args_parse__(argv, usage=""):
parser.add_argument("color", metavar="COLOR", type=str, nargs='?', parser.add_argument("color", metavar="COLOR", type=str, nargs='?',
default="red", default="red",
help="A number in [0…255], a color name, a colormap name, \ help="A number in [0…255], a color name, a colormap name, \
a palette or a comma-separated list of those values."+pygments_warn) a palette or a comma-separated list of those values." + pygments_warn)
parser.add_argument("style", metavar="STYLE", type=str, nargs='?', parser.add_argument("style", metavar="STYLE", type=str, nargs='?',
default="bold", default="bold",
help="One of the available styles or a comma-separated list of styles.") help="One of the available styles or a comma-separated list of styles.")
parser.add_argument("-g", "--groups", action="store_true", parser.add_argument("-g", "--groups", action="store_true",
help="For color maps (random, rainbow), iterate over matching groups \ help="For color maps (random, rainbow, etc.), iterate over matching groups \
in the pattern instead of over patterns") in the pattern instead of over patterns")
parser.add_argument("-c", "--colormap", action="store_true", parser.add_argument("-c", "--colormap", action="store_true",
@ -739,10 +739,10 @@ def __args_parse__(argv, usage=""):
help="Interpret REGEX as a theme.") help="Interpret REGEX as a theme.")
parser.add_argument("-T", "--themes-dir", metavar="DIR", action="append", parser.add_argument("-T", "--themes-dir", metavar="DIR", action="append",
help="Search for additional themes (colout_*.py files) in this directory") help="Search for additional themes (colout_*.py files) in the given directory")
parser.add_argument("-P", "--palettes-dir", metavar="DIR", action="append", parser.add_argument("-P", "--palettes-dir", metavar="DIR", action="append",
help="Search for additional palettes (*.gpl files) in this directory") help="Search for additional palettes (*.gpl files) in the given directory")
# This normally should be an option with an argument, but this would end in an error, # This normally should be an option with an argument, but this would end in an error,
# as no regexp is supposed to be passed after calling this option, # as no regexp is supposed to be passed after calling this option,
@ -753,14 +753,14 @@ def __args_parse__(argv, usage=""):
(styles, colors, special, themes, palettes, colormaps or lexers), \ (styles, colors, special, themes, palettes, colormaps or lexers), \
use 'all' to print everything.") use 'all' to print everything.")
parser.add_argument("--debug", action="store_true",
help="Debug mode: print what's going on internally, useful if you want to check what features are available.")
parser.add_argument("-s", "--source", action="store_true", parser.add_argument("-s", "--source", action="store_true",
help="Interpret REGEX as a source code readable by the Pygments library. \ help="Interpret REGEX as a source code readable by the Pygments library. \
If the first letter of PATTERN is upper case, use the 256 colors mode, \ If the first letter of PATTERN is upper case, use the 256 colors mode, \
if it is lower case, use the 8 colors mode. \ if it is lower case, use the 8 colors mode. \
Interpret COLOR as a Pygments style.") Interpret COLOR as a Pygments style." + pygments_warn)
parser.add_argument("--debug", action="store_true",
help="Debug mode: print what's going on internally, useful if you want to check what features are available.")
args = parser.parse_args() args = parser.parse_args()