diff options
| author | r-richmond <rrichmond.gh@gmail.com> | 2020-07-12 21:04:02 -0700 |
|---|---|---|
| committer | r-richmond <rrichmond.gh@gmail.com> | 2020-07-12 21:04:02 -0700 |
| commit | e2ec04ce43e423dfc1aff88ce95b372620b9560a (patch) | |
| tree | 74101cb01159d90da6036dfa2bd0ded904af356c /scripts | |
| parent | 74fc0b0ce18e29c51a45534b4bc02a77571531a7 (diff) | |
| download | isort-e2ec04ce43e423dfc1aff88ce95b372620b9560a.tar.gz | |
add example cli usage
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/build_config_option_docs.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/build_config_option_docs.py b/scripts/build_config_option_docs.py index 6a094b54..54db3491 100755 --- a/scripts/build_config_option_docs.py +++ b/scripts/build_config_option_docs.py @@ -67,12 +67,13 @@ class Example: .lstrip() ) - if self.cli == "": + if self.cli: cli = dedent(self.cli).lstrip() self.cli = ( dedent( """ ### Example cli usage + `{cli}` """ ) @@ -80,11 +81,11 @@ class Example: .lstrip() ) + sections = [s for s in [self.cfg, self.pyproject_toml, self.cli] if s] + sections_str = "\n".join(sections) self.section_complete = f"""**Examples:** -{self.cfg} -{self.pyproject_toml} -{self.cli}""" +{sections_str}""" else: self.section_complete = "" @@ -106,6 +107,7 @@ example_mapping = { known_airflow = ['airflow']""", ), "multi_line_output": Example(cfg="multi_line_output=3", pyproject_toml="multi_line_output = 3"), + "show_version": Example(cli="isort --version"), } |
