Browse Source

[songbook] Nicer formatted help text

pull/195/head
Louis 9 years ago
parent
commit
6702a740db
  1. 29
      patacrep/songbook/__main__.py

29
patacrep/songbook/__main__.py

@ -51,6 +51,7 @@ def argument_parser(args):
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
prog="songbook", prog="songbook",
description="A song book compiler", description="A song book compiler",
formatter_class=argparse.RawTextHelpFormatter,
) )
parser.add_argument( parser.add_argument(
@ -65,9 +66,8 @@ def argument_parser(args):
parser.add_argument( parser.add_argument(
'--datadir', '-d', nargs='+', type=str, action='append', '--datadir', '-d', nargs='+', type=str, action='append',
help=textwrap.dedent("""\ help=textwrap.dedent("""\
Data location. Expected (not necessarily required) Data location. Expected (not necessarily required) subdirectories are 'songs', 'img', 'latex', 'templates'.
subdirectories are 'songs', 'img', 'latex', 'templates'. """),
""")
) )
parser.add_argument( parser.add_argument(
@ -90,20 +90,15 @@ def argument_parser(args):
'--steps', '-s', nargs=1, type=str, '--steps', '-s', nargs=1, type=str,
action=ParseStepsAction, action=ParseStepsAction,
help=textwrap.dedent("""\ help=textwrap.dedent("""\
Steps to run. Default is "{steps}". Steps to run. Default is "{steps}". Available steps are:
Available steps are: - "tex" produce .tex file from templates;
"tex" produce .tex file from templates; - "pdf" compile .tex file;
"pdf" compile .tex file; - "sbx" compile index files;
"sbx" compile index files; - "clean" remove temporary files;
"clean" remove temporary files; - any string beginning with '#' (in this case, it will be run in a shell).
any string beginning with '#' (in this case, it will be run Several steps (excepted the custom shell command) can be combinend in one --steps argument, as a comma separated string.
in a shell). Several steps (excepted the custom shell
command) can be combinend in one --steps argument, as a Substring {{basename}} is replaced by the basename of the song book, and substrings {{aux}}, {{log}}, {{out}}, {{pdf}}, {{sxc}}, {{tex}} are replaced by "<BASENAME>.aux", "<BASENAME>.log", and so on.
comma separated string.
Substring {{basename}} is replaced by the basename of the song
book, and substrings {{aux}}, {{log}}, {{out}}, {{pdf}}, {{sxc}}, {{tex}}
are replaced by "<BASENAME>.aux", "<BASENAME>.log", and so on.
""".format(steps=','.join(DEFAULT_STEPS))), """.format(steps=','.join(DEFAULT_STEPS))),
default=None, default=None,
) )

Loading…
Cancel
Save