Skip to content

Conversation

@zhubonan
Copy link

I have added a built-in help system for INPUT parameters.

Usage

# Show general help
abacus -h

# Get detailed help for a parameter
abacus -h ecutwfc

# Search for parameters matching keyword
abacus -s ecut
# Finds: ecutwfc, ecutrho, lcao_ecut, etc.

# Typo suggestions
abacus -h ecutwf
# Error: Unknown parameter 'ecutwf'
# Did you mean: ecutwfc

Implementation

  • source/source_io/input_help.{h,cpp} - Help system class with search and fuzzy matching
  • source/source_io/input_help_data.h - Auto-generated parameter data (4295 lines, 458 parameters)
  • source/source_io/parse_args.cpp - Command-line argument handling
  • tools/generate_help_data.py - Build-time code generator from markdown
  • Documentation integrated into docs/quick_start/input.md

- Add -h/--help flag for parameter documentation
- Add -s/--search flag for keyword search
- Implement fuzzy matching for typo suggestions (Levenshtein distance)
- Case-insensitive parameter lookup
- Auto-generate help data from markdown at build time
- 458 parameters documented with comprehensive metadata

Usage: abacus -h <param>, abacus -s <keyword>

refactor(help): improve help system with critical fixes and performance optimizations

docs(help): integrate help system documentation into quick start guide

Add concise help system section to docs/quick_start/input.md covering:
- Basic commands (-h, -s flags)
- Example output for parameter lookup
- Fuzzy matching for typo suggestions
- Case-insensitive lookup behavior

Remove standalone documentation files that are now redundant:
- docs/HELP_SYSTEM.md
- docs/FUZZY_SEARCH.md
- Add input_help.cpp to MODULE_IO_parse_args test sources to fix linker error
- Fix input_help_test.cpp include path and use value syntax instead of pointer
- Fix parse_args_test.cpp death tests to use EXPECT_EXIT regex matching
  instead of CaptureStderr which doesn't work properly with fork()
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.

1 participant