Skip to content

Commit 5dc52b5

Browse files
authored
Merge pull request #76 from dwhswenson/compile-help
Add help to compile; make it visible in CLI help
2 parents b05951c + 78f967b commit 5dc52b5

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

paths_cli/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def get_command(self, ctx, name):
6161
return self._get_command.get(name)
6262

6363
def format_commands(self, ctx, formatter):
64-
sec_order = ['Simulation', 'Analysis', 'Miscellaneous', 'Workflow']
64+
sec_order = ["Simulation Setup", 'Simulation', 'Analysis',
65+
'Miscellaneous', 'Workflow']
6566
for sec in sec_order:
6667
cmds = self._sections.get(sec, [])
6768
rows = []

paths_cli/commands/compile.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,18 @@ def register_installed_plugins():
6868

6969
@click.command(
7070
'compile',
71+
short_help="compile a description of OPS objects into a database",
7172
)
7273
@click.argument('input_file')
7374
@OUTPUT_FILE.clicked(required=True)
7475
def compile_(input_file, output_file):
76+
"""Compile JSON or YAML description of OPS objects into a database.
77+
78+
INPUT_FILE is a JSON or YAML file that describes OPS simulation
79+
objects (e.g., MD engines, state volumes, etc.). The output will be an
80+
OPS database containing those objects, which can be used as the input to
81+
many other CLI subcommands.
82+
"""
7583
loader = select_loader(input_file)
7684
with open(input_file, mode='r') as f:
7785
dct = loader(f)
@@ -87,7 +95,7 @@ def compile_(input_file, output_file):
8795

8896
PLUGIN = OPSCommandPlugin(
8997
command=compile_,
90-
section="Debug",
98+
section="Simulation Setup",
9199
requires_ops=(1, 0),
92100
requires_cli=(0, 3)
93101
)

paths_cli/compiling/_gendocs/docs_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def generate_category_rst(self, category_plugin):
5454
rst = f".. _compiling--{category_plugin.label}:\n\n"
5555
rst += f"{cat_info.header}\n{'=' * len(str(cat_info.header))}\n\n"
5656
if cat_info.description:
57-
rst += cat_info.description + "\n\n"
57+
rst += cat_info.description + "The following types are available:\n\n"
5858
rst += ".. contents:: :local:\n\n"
5959
for obj in category_plugin.type_dispatch.values():
6060
rst += self.generate_plugin_rst(

paths_cli/tests/compiling/_gendocs/test_docs_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def setup_method(self):
5050
".. _compiling--category:",
5151
"Header\n======\n",
5252
".. contents:: :local:",
53-
"\ncategory_desc\n",
53+
"\ncategory_descThe following types are available:\n",
5454
]
5555

5656
@pytest.mark.parametrize('param_type', ['req', 'opt'])

0 commit comments

Comments
 (0)