Skip to content

Commit 29b4d40

Browse files
committed
Document CLI options
1 parent 08b142d commit 29b4d40

File tree

4 files changed

+2016
-8
lines changed

4 files changed

+2016
-8
lines changed

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ COMPOSER := composer
22
PHPUNIT := vendor/bin/phpunit
33
FIXER := php build/php-cs-fixer.phar
44
PSALM := php build/psalm.phar
5+
CMDS = $(wildcard src/Command/*.php)
56

67
.PHONY:test
7-
test: test-fixer psalm test-phpunit
8+
test: test-fixer psalm test-phpunit check-docs
89

910
.PHONY:test-fixer
1011
test-fixer: build/php-cs-fixer.phar
@@ -15,7 +16,7 @@ test-phpunit: vendor/autoload.php
1516
$(PHPUNIT)
1617

1718
.PHONY:validate
18-
validate: build/php-cs-fixer.phar vendor/autoload.php psalm
19+
validate: build/php-cs-fixer.phar vendor/autoload.php psalm check-docs
1920
$(FIXER) fix --dry-run --stop-on-violation
2021
$(COMPOSER) validate
2122
phpdbg -qrr $(PHPUNIT) --coverage-text
@@ -28,6 +29,11 @@ psalm: build/psalm.phar
2829
psalm-update-baseline: build/psalm.phar
2930
$(PSALM) --update-baseline
3031

32+
.PHONY:check-docs
33+
check-docs: docs/CLI.md
34+
@echo "CHECKING if 'docs/CLI.md' needs to be committed due to changes. If this fails, simply commit the changes."
35+
git diff-files --quiet docs
36+
3137
# Downloads everything we need for testing, used by Travis.
3238
.PHONY: init
3339
init: vendor/autoload.php build/php-cs-fixer.phar build/psalm.phar
@@ -65,3 +71,11 @@ vendor/autoload.php: composer.lock composer.json
6571
$(COMPOSER) self-update
6672
$(COMPOSER) install --no-suggest --no-progress
6773
touch $@
74+
75+
docs/CLI.md: $(CMDS)
76+
@rm -f $@
77+
@echo "<!-- AUTOMATICALLY GENERATED -->" >> $@
78+
@echo "<!-- REGENERATE VIA: make $@ -->" >> $@
79+
@echo "" >> $@
80+
@php bin/moodle-plugin-ci list --format md > $@
81+
@echo "REGENERATED $@"

docs/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
99
The format of this change log follows the advice given at [Keep a CHANGELOG](http://keepachangelog.com).
1010

1111
## [Unreleased]
12-
No unreleased changes.
12+
### Added
13+
- New help document: [CLI commands and options](CLI.md)
1314

1415
## [2.5.0] - 2019-02-20
1516
### Changed

0 commit comments

Comments
 (0)