From 7f5aeea2fe0252605314f8a471197faed4f16e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Karlovi=C4=87?= Date: Mon, 9 Jan 2023 10:39:54 +0100 Subject: [PATCH] fix: make help always the default command (#106) --- resources/Common/default.mk | 1 + tests/functional/MakefileTestCase.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/resources/Common/default.mk b/resources/Common/default.mk index a8972cb..1fddf6c 100644 --- a/resources/Common/default.mk +++ b/resources/Common/default.mk @@ -6,6 +6,7 @@ ifndef SIGWIN_INFRA_ROOT $(error SIGWIN_INFRA_ROOT must be defined before loading Common/default.mk) endif +.DEFAULT_GOAL := help .DEPRECATED: $(warning NOTE: target "${DEPRECATED_FROM}" has been deprecated, use "${DEPRECATED_TO}" instead.) diff --git a/tests/functional/MakefileTestCase.php b/tests/functional/MakefileTestCase.php index 67ddc2e..187a9e5 100644 --- a/tests/functional/MakefileTestCase.php +++ b/tests/functional/MakefileTestCase.php @@ -78,6 +78,14 @@ public function testMakefileHasHelp(): void static::assertSame($expected, $actual); } + public function testHelpIsTheDefaultCommand(): void + { + $expected = $this->dryRun($this->getMakefilePath(), 'help'); + $actual = $this->dryRun($this->getMakefilePath()); + + static::assertSame($expected, $actual); + } + /** * @dataProvider generateHelpCommandsExecutionPathFixtures */