Skip to content

[NO-ISSUE] Add bash autocompletion for markdown-runner#15

Merged
lavocatt merged 1 commit into
arkmq-org:mainfrom
lavocatt:feature/autocompletion
Oct 1, 2025
Merged

[NO-ISSUE] Add bash autocompletion for markdown-runner#15
lavocatt merged 1 commit into
arkmq-org:mainfrom
lavocatt:feature/autocompletion

Conversation

@lavocatt

@lavocatt lavocatt commented Sep 29, 2025

Copy link
Copy Markdown
Member

Add bash completion for markdown-runner with advanced features:

Core Completion Features

  • Stage/chunk completion - complete stage names and chunk IDs from markdown files
  • File@stage format - complete file-specific stages (e.g., README.md@setup)
  • Smart context detection - different behavior for files vs directories vs recursive mode
  • Flag completion - all command-line flags with intelligent filtering
  • Enhanced help - categorized help with descriptions (markdown-runner -<TAB>)

Advanced Capabilities

  • Flag filtering - excludes already-used and incompatible flags
  • Directory-aware - shows file@ completions in directory contexts
  • Smart nospace - intelligent trailing space behavior for optimal chaining
  • Recursive support - adapts completions based on -r/--recursive flag
  • File discovery - automatically finds and parses markdown files for stages

Quality Assurance

  • 191 tests across 18 test suites - complete coverage of all scenarios
  • CI integration - tests run automatically in GitHub Actions
  • Cross-environment tested - works in development and CI environments
  • Regression prevention - ensures reliability of completion features

Installation & Usage

# Install completion
./completion/install.sh

# Examples of completion features
markdown-runner -B <TAB>           # Shows stages and file@ options
markdown-runner -B setup/<TAB>     # Shows chunks in setup stage  
markdown-runner test/cases/ -B <TAB>  # Shows file@ completions for directory
markdown-runner -<TAB>             # Shows enhanced help with descriptions

Documentation

  • Complete usage documentation in completion/README.md
  • Comprehensive test suite documentation in completion/tests/README.md
  • Updated main README with completion examples and features

This adds a completion system that significantly improves the
user experience when working with markdown-runner's debugging and execution features.

@brusdev

brusdev commented Sep 30, 2025

Copy link
Copy Markdown
Member

This branch has conflicts, can you rebase it?

@lavocatt lavocatt force-pushed the feature/autocompletion branch 2 times, most recently from 010b5eb to 8f4576a Compare September 30, 2025 08:05
@lavocatt

Copy link
Copy Markdown
Member Author

@brusdev I've performed the rebase and overhaul, now it's tested with a new regression test suite.

Comment thread README.md Outdated
Comment thread completion/README.md Outdated
@lavocatt lavocatt force-pushed the feature/autocompletion branch from e378e39 to 4de86bb Compare September 30, 2025 10:34
@lavocatt lavocatt requested a review from brusdev September 30, 2025 10:34
Add intelligent bash completion for markdown-runner with advanced features:

- **Stage/chunk completion** - complete stage names and chunk IDs from markdown files
- **File@stage format** - complete file-specific stages (e.g., `README.md@setup`)
- **Smart context detection** - different behavior for files vs directories vs recursive mode
- **Flag completion** - all command-line flags with intelligent filtering
- **Enhanced help** - categorized help with descriptions (`markdown-runner -<TAB>`)

- **Flag filtering** - excludes already-used and incompatible flags
- **Directory-aware** - shows file@ completions in directory contexts
- **Smart nospace** - intelligent trailing space behavior for optimal chaining
- **Recursive support** - adapts completions based on `-r/--recursive` flag
- **File discovery** - automatically finds and parses markdown files for stages

- **191 tests across 18 test suites** - complete coverage of all scenarios
- **CI integration** - tests run automatically in GitHub Actions
- **Regression prevention** - ensures reliability of completion features

```bash
./completion/install.sh

markdown-runner -B <TAB>           # Shows stages and file@ options
markdown-runner -B setup/<TAB>     # Shows chunks in setup stage
markdown-runner test/cases/ -B <TAB>  # Shows file@ completions for directory
markdown-runner -<TAB>             # Shows enhanced help with descriptions
```

- Usage documentation in `completion/README.md`
- Test suite documentation in `completion/tests/README.md`
- Updated main README with completion examples and features

This adds a completion system that significantly improves
the user experience when working with markdown-runner's debugging and
execution features.
@lavocatt lavocatt force-pushed the feature/autocompletion branch from 4de86bb to 66aff42 Compare September 30, 2025 12:43
@brusdev

brusdev commented Oct 1, 2025

Copy link
Copy Markdown
Member

LGTM the autocompletion is a very useful feature.

@lavocatt

lavocatt commented Oct 1, 2025

Copy link
Copy Markdown
Member Author

Thanks you for you review @brusdev I really appreciate your feedback

@lavocatt lavocatt merged commit 25f611c into arkmq-org:main Oct 1, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants