Skip to content

v1.10.1 - Text Command Help Refactoring (2025-12-04)

What Changed?

This release improves the HELP command implementation by generating its output dynamically from the command dispatch table. This eliminates code duplication and ensures the help text automatically stays synchronized with command definitions, reducing maintenance burden when adding new commands.


What's New

Main Feature: Dynamic HELP Output

What it does: The HELP command now generates its output by iterating through command_table instead of hardcoding command information. This ensures help text is always up-to-date and matches the actual available commands.

How to use it: Send the HELP or H command via serial to see all available commands with their categories, descriptions, and aliases.

Code example:

// Before: 71 lines of hardcoded command definitions
JsonObject cmd1 = commands.createNestedObject();
cmd1["alias"] = "C";
cmd1["command"] = "SET_POLL_COUNT";
// ... repeated for each command

// After: 17 lines using command_table iteration
for (int i = 0; command_table[i].name != NULL; i++) {
  const command_entry_t* entry = &command_table[i];
  JsonObject cmd_obj = commands.createNestedObject();
  cmd_obj["command"] = entry->name;
  cmd_obj["category"] = entry->category;
  cmd_obj["description"] = entry->description;
  // ... add aliases
}

Installation

Quick Start

# Get the release
git checkout v1.10.1

# Build
task build

# Upload
task upload

# Check it works
task monitor

What's Different from v1.10.0?

✅ Added

  • Dynamic HELP output generation from command_table
  • Category and aliases fields in HELP response for better organization

🔧 Changed

  • HELP JSON response format now includes category and aliases array fields
  • command_table is now the single source of truth for command information
  • StaticJsonDocument size increased from 512 to 1024 bytes for safety

🐛 Fixed

  • HELP output is now guaranteed to stay synchronized with available commands
  • Eliminates risk of help text becoming outdated when commands are added/removed

Is It Safe to Upgrade?

Backward Compatible: Yes

  • Existing command functionality unchanged
  • Only HELP output format improved
  • All commands work exactly as before

Tests Passed

  • ✅ Builds without errors
  • ✅ All pre-commit hooks pass (commitizen, trailing whitespace, merge conflict checks)
  • ✅ HELP command returns properly formatted JSONL with all commands
  • ✅ Command aliases display correctly in help output

Release Details

  • Date: 2025-12-04
  • Version: v1.10.1
  • Files Changed: 2 (src/text_command_handlers.cpp, uv.lock)
  • Commits: 37db666 (refactor(text-commands): generate HELP output dynamically from command_table)

Next Steps

  • Monitor for any HELP output formatting issues in production
  • Consider similar refactoring patterns for other dynamically-generated outputs
  • Continue feature development based on roadmap