Skip to content

Commit 86733d0

Browse files
committed
Add --help to CLI
1 parent e178831 commit 86733d0

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/papyrus_scripts/cli.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
from .subsim_search import FPSubSim2
1515
from .fingerprint import Fingerprint, get_fp_from_name
1616

17-
@click.group()
17+
18+
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
19+
20+
21+
@click.group(context_settings=CONTEXT_SETTINGS)
1822
def main():
1923
pass
2024

21-
@main.command(help='Download Papyrus data.')
25+
26+
@main.command(help='Download Papyrus data.', context_settings=CONTEXT_SETTINGS)
2227
@click.option('-o', '--out_dir', 'output_directory', type=str, required=False,
2328
default=None, nargs=1, show_default=True, metavar='OUTDIR',
2429
help='Directory where Papyrus data will be stored\n(default: pystow\'s home folder).')
@@ -68,7 +73,7 @@ def download(output_directory, version, more, stereo, structs, descs, force):
6873
disk_margin=0.0 if force else 0.1)
6974

7075

71-
@main.command(help='Remove Papyrus data.')
76+
@main.command(help='Remove Papyrus data.', context_settings=CONTEXT_SETTINGS)
7277
@click.option('-o', '--out_dir', 'output_directory', type=str, required=False,
7378
default=None, nargs=1, show_default=True, metavar='OUTDIR',
7479
help='Directory where Papyrus data will be removed\n(default: pystow\'s home folder).')
@@ -131,7 +136,7 @@ def clean(output_directory, version, papyruspp, stereo, bioactivities, proteins,
131136
progress=True)
132137

133138

134-
@main.command(help='Identify matches of the RCSB PDB data in the Papyrus data.')
139+
@main.command(help='Identify matches of the RCSB PDB data in the Papyrus data.', context_settings=CONTEXT_SETTINGS)
135140
@click.option('--indir', '-i', 'indir', type=str, required=False, default=None, nargs=1,
136141
metavar='INDIR', show_default=True,
137142
help='Directory where Papyrus data will be stored\n(default: pystow\'s home folder).')
@@ -203,7 +208,8 @@ def handle_parse_result(self, ctx, opts, args):
203208
return super(Mutex, self).handle_parse_result(ctx, opts, args)
204209

205210

206-
@main.command(help='Create a FPSubSim2 library for substructure/similarity searches.')
211+
@main.command(help='Create a FPSubSim2 library for substructure/similarity searches.',
212+
context_settings=CONTEXT_SETTINGS)
207213
@click.option('-i, --indir', 'indir', type=str, required=False, default=None, nargs=1,
208214
metavar='INDIR', show_default=True,
209215
help='Directory where Papyrus data will be stored\n(default: pystow\'s home folder).')
@@ -313,7 +319,8 @@ def fpsubsim2(indir, output, version, is3D, fingerprint, verbose, njobs, fingerp
313319
progress=verbose, njobs=njobs)
314320

315321

316-
@main.command(help='Transform the compression of Papyrus files from LZMA to Gzip and vice-versa.')
322+
@main.command(help='Transform the compression of Papyrus files from LZMA to Gzip and vice-versa.',
323+
context_settings=CONTEXT_SETTINGS)
317324
@click.option('-i', '--indir', 'indir', type=str, required=False, default=None, nargs=1,
318325
metavar='INDIR', show_default=True,
319326
help='Directory where Papyrus data is stored\n(default: pystow\'s home folder).')

0 commit comments

Comments
 (0)