Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions doc/man/crystal-tool-macro_code_coverage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
= crystal-tool-macro_code_coverage(1)
:doctype: manpage
:date: {localdate}
:crystal_version: {crystal_version}
:man manual: Crystal Compiler Command Line Reference Guide
:man source: crystal {crystal_version}

== Name
crystal-tool-macro_code_coverage - generate a macro code coverage report.

== Synopsis
*crystal tool macro_code_coverage* [options] [programfile]

== Description

Generate and output a macro code coverage report to STDERR.
Any exception raised while computing the report is written to STDOUT.

== Options

*-D* _FLAG_, *--define*=_FLAG_::
Define a compile-time flag. This is useful to con ditionally define types, methods, or commands based
on flags available at compile time. The default
flags are from the target triple given with *--tar* get-triple or the hosts default, if none is given.
*-f* _FORMAT_, *--format*=_FORMAT_::
Output format 'codecov' (default).
*-i* _PATH_, *--include*=_PATH_::
Include path in output.
*-e* _PATH_, *--exclude*=_PATH_::
Exclude path in output (default: lib).
*--error-trace*::
Show full error trace.
*--prelude*::
Specify prelude to use. The default one initializes
the garbage collector. You can also use *--pre* lude=empty to use no preludes. This can be useful
for checking code generation for a specific source
code file.
*-s*, *--stats*::
Print statistics about the different compiler stages for the current build. Output time and used memory for each compiler
process.
*-p*, *--progress*::
Print statistics about the progress for the current build.
*-t*, *--time*::
Print statistics about the execution time.
*--no-color*::
Disable colored output.
2 changes: 2 additions & 0 deletions doc/man/crystal.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ regex by using the *-e* flag.
Show implementations for a given call. Use *--cursor* to specify the cursor position. The format for the cursor position
is file:line:column.

*crystal-tool-macro_code_coverage*:: Generate a macro code coverage report.

*crystal-tool-types*:: Show type of main variables of file.

*crystal-tool-unreachable(1)*:: Identify methods that are never called
Expand Down
2 changes: 1 addition & 1 deletion etc/completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ _crystal()
_crystal_compgen_options "${opts}" "${cur}"
else
if [[ "${prev}" == "tool" ]] ; then
local subcommands="context dependencies expand flags format hierarchy implementations types unreachable"
local subcommands="context dependencies expand flags format hierarchy implementations macro_code_coverage types unreachable"
_crystal_compgen_options "${subcommands}" "${cur}"
else
_crystal_compgen_sources "${cur}"
Expand Down
13 changes: 13 additions & 0 deletions etc/completion.fish
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,19 @@ complete -c crystal -n "__fish_seen_subcommand_from unreachable" -s p -l progres
complete -c crystal -n "__fish_seen_subcommand_from unreachable" -s t -l time -d "Enable execution time output"
complete -c crystal -n "__fish_seen_subcommand_from unreachable" -l stdin-filename -d "Source file name to be read from STDIN"

complete -c crystal -n "__fish_seen_subcommand_from tool; and not __fish_seen_subcommand_from $tool_subcommands" -a "macro_code_coverage" -d "generate a macro code coverage report" -x
complete -c crystal -n "__fish_seen_subcommand_from macro_code_coverage" -s D -l define -d "Define a compile-time flag"
complete -c crystal -n "__fish_seen_subcommand_from macro_code_coverage" -s f -l format -d "Output format codecov (default)" -a "codecov" -f
complete -c crystal -n "__fish_seen_subcommand_from macro_code_coverage" -l error-trace -d "Show full error trace"
complete -c crystal -n "__fish_seen_subcommand_from macro_code_coverage" -s i -l include -d "Include path"
complete -c crystal -n "__fish_seen_subcommand_from macro_code_coverage" -s e -l exclude -d "Exclude path (default: lib)"
complete -c crystal -n "__fish_seen_subcommand_from macro_code_coverage" -l no-color -d "Disable colored output"
complete -c crystal -n "__fish_seen_subcommand_from macro_code_coverage" -l prelude -d "Use given file as prelude"
complete -c crystal -n "__fish_seen_subcommand_from macro_code_coverage" -s s -l stats -d "Enable statistics output"
complete -c crystal -n "__fish_seen_subcommand_from macro_code_coverage" -s p -l progress -d "Enable progress output"
complete -c crystal -n "__fish_seen_subcommand_from macro_code_coverage" -s t -l time -d "Enable execution time output"
complete -c crystal -n "__fish_seen_subcommand_from macro_code_coverage" -l stdin-filename -d "Source file name to be read from STDIN"

complete -c crystal -n "__fish_seen_subcommand_from tool; and not __fish_seen_subcommand_from $tool_subcommands" -a "types" -d "show type of main variables" -x
complete -c crystal -n "__fish_seen_subcommand_from types" -s D -l define -d "Define a compile-time flag"
complete -c crystal -n "__fish_seen_subcommand_from types" -s f -l format -d "Output format text (default) or json" -a "text json" -f
Expand Down
13 changes: 13 additions & 0 deletions etc/completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ _crystal-tool() {
"format:format project, directories and/or files"
"hierarchy:show type hierarchy"
"implementations:show implementations for given call in location"
"macro_code_coverage:generate a macro code coverage report"
"types:show type of main variables"
"unreachable:show methods that are never called"
)
Expand Down Expand Up @@ -277,6 +278,18 @@ _crystal-tool() {
$stdin_filename_args
;;

(macro_code_coverage)
_arguments \
$programfile \
$help_args \
$no_color_args \
$exec_args \
$include_exclude_args \
'(-f --format)'{-f,--format}'[output format: codecov (default)]:' \
$prelude_args \
$stdin_filename_args
;;

(types)
_arguments \
$programfile \
Expand Down
Loading
Loading