---
id: TASK-2.3
title: Improve coverage for core/cli and core/exec
status: Done
assignee:
  - codex
created_date: '2026-02-23 13:34'
updated_date: '2026-02-23 19:28'
labels:
  - tests
  - coverage
dependencies: []
references:
  - src/core/cli.rs
  - src/core/exec.rs
parent_task_id: TASK-2
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
Add unit tests to cover remaining branches/lines in CLI parsing and exec helpers without executing real commands.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Coverage increases for CLI parsing branches and exec helper paths.
- [x] #2 Tests avoid executing real commands (use dry-run and invalid command paths only).
- [x] #3 Tests are behavior-driven and avoid shallow line hits.
<!-- AC:END -->

## Implementation Plan

<!-- SECTION:PLAN:BEGIN -->
1) Add CLI parsing tests for additional subcommands/flags (flash, conf, boards, runners, profiles) to cover remaining branches.
2) Add exec tests for formatting with cwd and whitespace args, plus error formatting paths, without executing real commands.
3) Run `just test` and `just coverage` to confirm improvement.
<!-- SECTION:PLAN:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
Plan approved by user on 2026-02-23.

Added CLI tests for simple subcommands plus conf/flash passthrough in `src/core/cli.rs`.

Added exec tests for pretty command formatting with cwd/whitespace and ExecError display formatting in `src/core/exec.rs`.

Ran `just test` and `just coverage`. Core/exec now ~92% regions; overall coverage ~86.9% due largely to main.rs and remaining core/config coverage gaps.
<!-- SECTION:NOTES:END -->
