Skip to content

Commit 58151a5

Browse files
authored
fix: Help text: mention --gcov alias in Automation section (fixes #1213) (#1214)
Summary - Update help text to mention `--gcov` alias alongside `--discover-and-gcov` for consistency with README and parser. - Align error suggestions to prefer `--gcov` (alias) and remove misleading gcov path suggestion; advise ensuring `gcov` on `PATH`. Scope - src/config/help/config_help_core.f90 - src/core/error/error_handlers.f90 - No behavior changes. Verification - Build and test: - Command: fpm test Output excerpt: Project compiled successfully. OK: cli flags rejection minimal - Help text: - Command: fpm run -- --help | sed -n '1,40p' Output excerpt includes: "Use --gcov (alias: --discover-and-gcov)" Automation section shows `--gcov` and alias line. Rationale - Keep user-facing messages consistent across help and error suggestions. Remove stale guidance implying `--gcov` accepts a path value, which is no longer supported.
1 parent 97b28a3 commit 58151a5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/config/help/config_help_core.f90

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ subroutine show_help_information()
2020
print '(A)', "Usage: fortcov [OPTIONS] [COVERAGE_FILES...]"
2121
print '(A)', ""
2222
print '(A)', "Note: FortCov analyzes existing .gcov files by default."
23-
print '(A)', " Use --discover-and-gcov to auto-discover builds and run gcov."
23+
print '(A)', " Use --gcov (alias: --discover-and-gcov) to auto-discover builds and run gcov."
2424
print '(A)', ""
2525
print '(A)', "Options:"
2626
print '(A)', " -h, --help Show this help and exit"
@@ -39,11 +39,12 @@ subroutine show_help_information()
3939
print '(A)', " --fail-under PERCENT Exit non-zero if coverage below PERCENT"
4040
print '(A)', ""
4141
print '(A)', "Automation:"
42-
print '(A)', " --discover-and-gcov Auto-discover builds and run gcov before analysis"
42+
print '(A)', " --gcov Auto-discover builds and run gcov before analysis"
43+
print '(A)', " (alias: --discover-and-gcov)"
4344
print '(A)', ""
4445
print '(A)', "Examples:"
4546
print '(A)', " fortcov --source=src *.gcov --output=report.md"
46-
print '(A)', " fortcov --discover-and-gcov --fail-under 80"
47+
print '(A)', " fortcov --gcov --fail-under 80"
4748
print '(A)', ""
4849
print '(A)', "For more information, visit: https://github.com/lazy-fortran/fortcov"
4950

src/core/error/error_handlers.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ subroutine handle_invalid_config(config_file, line_number, error_ctx)
109109
error_ctx%suggestion = trim(error_ctx%suggestion) // char(10) // &
110110
"2. Example: fortcov --source=src *.gcov --output=coverage.md"
111111
error_ctx%suggestion = trim(error_ctx%suggestion) // char(10) // &
112-
"3. For auto mode: fortcov --discover-and-gcov"
112+
"3. For auto mode: fortcov --gcov (alias: --discover-and-gcov)"
113113

114114
write(error_ctx%context, '(A)') "Configuration parsing"
115115
end subroutine handle_invalid_config
@@ -196,7 +196,7 @@ subroutine handle_gcov_not_found(gcov_path, error_ctx)
196196
error_ctx%suggestion = trim(error_ctx%suggestion) // char(10) // &
197197
"2. Find gcov location: which gcov || find /usr -name 'gcov*'"
198198
error_ctx%suggestion = trim(error_ctx%suggestion) // char(10) // &
199-
"3. Specify path: --gcov=/usr/bin/gcov-11"
199+
"3. Ensure gcov is on PATH (e.g., gcov-11)"
200200
error_ctx%suggestion = trim(error_ctx%suggestion) // char(10) // &
201201
"4. Check gcc installation: gcc --version"
202202

0 commit comments

Comments
 (0)