Skip to content

Commit 1f711c8

Browse files
Copilotchefgs
andcommitted
fix: add HOW TO USE footer to process-first default output
When users run `python -m cli.devopsos process-first` with no arguments they now see a HOW TO USE THIS COMMAND footer at the end of the output, showing every --section option and the --help flag inline. The footer only appears on the default 'all' output; focused --section invocations remain uncluttered. - cli/process_first.py: USAGE_FOOTER constant appended to 'all' section - cli/test_cli.py: two new tests (footer present on default, absent on specific sections) Co-authored-by: chefgs <7605658+chefgs@users.noreply.github.com>
1 parent 706b3df commit 1f711c8

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

cli/process_first.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,25 @@
139139
140140
"""
141141

142+
USAGE_FOOTER = """\
143+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
144+
HOW TO USE THIS COMMAND
145+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
146+
147+
python -m cli.devopsos process-first # full overview (this output)
148+
python -m cli.devopsos process-first --section what # 5 core principles only
149+
python -m cli.devopsos process-first --section mapping # devopsos scaffold command map
150+
python -m cli.devopsos process-first --section tips # AI prompts for beginners
151+
python -m cli.devopsos process-first --help # full option reference
152+
153+
You can also run the standalone module:
154+
155+
python -m cli.process_first [--section what|mapping|tips|all]
156+
157+
📖 Full docs: docs/PROCESS-FIRST.md
158+
159+
"""
160+
142161
FULL_TEXT = (
143162
PROCESS_FIRST_SUMMARY
144163
+ WHAT_IS_PROCESS_FIRST
@@ -155,7 +174,7 @@
155174
"what": PROCESS_FIRST_SUMMARY + WHAT_IS_PROCESS_FIRST,
156175
"mapping": PROCESS_FIRST_SUMMARY + MAPPING_TO_TOOLING,
157176
"tips": PROCESS_FIRST_SUMMARY + BEGINNER_TIPS,
158-
"all": FULL_TEXT,
177+
"all": FULL_TEXT + USAGE_FOOTER,
159178
}
160179

161180

cli/test_cli.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,3 +369,24 @@ def test_process_first_invalid_section_clean_error():
369369
assert "ValueError" not in combined, "Expected clean CLI error, not a ValueError"
370370
assert "is not one of" in combined or "Invalid value" in combined
371371

372+
373+
def test_process_first_default_output_includes_usage_footer():
374+
"""Default output (no --section) includes a HOW TO USE footer with section examples."""
375+
result = _run(["-m", "cli.devopsos", "process-first"])
376+
assert result.returncode == 0
377+
assert "HOW TO USE THIS COMMAND" in result.stdout
378+
assert "--section what" in result.stdout
379+
assert "--section mapping" in result.stdout
380+
assert "--section tips" in result.stdout
381+
assert "--help" in result.stdout
382+
383+
384+
def test_process_first_specific_section_no_usage_footer():
385+
"""Specific sections (not 'all') do NOT include the usage footer."""
386+
for section in ("what", "mapping", "tips"):
387+
result = _run(["-m", "cli.devopsos", "process-first", "--section", section])
388+
assert result.returncode == 0
389+
assert "HOW TO USE THIS COMMAND" not in result.stdout, (
390+
f"--section {section} should not show the usage footer"
391+
)
392+

0 commit comments

Comments
 (0)