Skip to content

Commit

Permalink
Fix Python version dependent help texts
Browse files Browse the repository at this point in the history
Ref. eng/recordflux/RecordFlux#1511
  • Loading branch information
treiher committed Feb 2, 2024
1 parent 6906766 commit d8e878f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/user_guide/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ EXISTING_HELP_FILES = $(wildcard 90-rflx-*-help.txt)
UNEXPECTED_HELP_FILES = $(filter-out $(EXPECTED_HELP_FILES),$(EXISTING_HELP_FILES))
MISSING_HELP_FILES = $(filter-out $(EXISTING_HELP_FILES),$(EXPECTED_HELP_FILES))

REPLACE_WORKERS = sed "s/workers (default: [0-9]*)/workers (default: NPROC)/"
CHECK = diff 90-rflx--help.txt <(rflx --help | $(REPLACE_WORKERS)) && $(foreach CMD,$(COMMANDS),diff $(call help_file,$(CMD)) <(rflx $(CMD) --help) &&) exit
NORMALIZE = sed -e "s/workers (default: [0-9]*)/workers (default: NPROC)/" -e "s/optional arguments:/options:/"
CHECK = diff 90-rflx--help.txt <(rflx --help | $(NORMALIZE)) && $(foreach CMD,$(COMMANDS),diff $(call help_file,$(CMD)) <(rflx $(CMD) --help | $(NORMALIZE)) &&) exit

check_help:
@test -z "$(MISSING_HELP_FILES)" || ( echo "Missing help files: $(MISSING_HELP_FILES)" && exit 1 )
@test -z "$(UNEXPECTED_HELP_FILES)" || ( echo "Unexpected help files: $(UNEXPECTED_HELP_FILES)" && exit 1 )
@( $(CHECK) ) || ( echo "Help texts are outdated" && exit 1 )

90-rflx-%--help.txt::
@rflx $* --help > $@
@rflx $* --help | $(NORMALIZE) > $@

90-rflx--help.txt:
@rflx --help | $(REPLACE_WORKERS) > $@
@rflx --help | $(NORMALIZE) > $@

# Regenerate rflx help texts for the documentation
# We do not do this automatically. The results are checked in as we don't
Expand Down

0 comments on commit d8e878f

Please sign in to comment.