From 0359bb7007a8320c34647ac7f3b6e453b844e5fe Mon Sep 17 00:00:00 2001 From: BafS Date: Thu, 31 Aug 2023 22:08:21 +0900 Subject: [PATCH] Add "bin" info in composer --- README.md | 12 +++++++++++- bin/{app.php => chip8} | 7 +++++-- composer.json | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) rename bin/{app.php => chip8} (95%) mode change 100644 => 100755 diff --git a/README.md b/README.md index 7569ae9..3abffc3 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## Run in the terminal - `composer i` -- `./bin/app.php ` +- `./bin/chip8 ` The default keyboard layout was mapped as follows: ``` @@ -25,6 +25,16 @@ A|0|B|F -> Z|X|C|V - `./vendor/bin/phpunit tests/ --testdox` +## Quality + +### Static Analysis + +- `./vendor/bin/phpstan analyse src/ -l 7` + +### Syntax lint + +- `./vendor/bin/phpcs --standard=PSR12 src/` + #### Documentation - https://chip-8.github.io/ diff --git a/bin/app.php b/bin/chip8 old mode 100644 new mode 100755 similarity index 95% rename from bin/app.php rename to bin/chip8 index d6b0d7b..5a30802 --- a/bin/app.php +++ b/bin/chip8 @@ -1,7 +1,10 @@ +#!/usr/bin/env php addArgument('file', InputArgument::OPTIONAL, 'The rom') - ->addOption('frequency', 'f', InputOption::VALUE_REQUIRED) + ->addArgument('file', InputArgument::REQUIRED, 'The rom file') + ->addOption('frequency', 'f', InputOption::VALUE_REQUIRED, 'Run the emulation with the given frequency') ->setCode($this->execute(...)) ->run(); } diff --git a/composer.json b/composer.json index bb82042..f064203 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,9 @@ "email": "fabacrans@gmail.com" } ], + "bin": [ + "bin/chip8" + ], "require": { "php": ">=8.1", "symfony/console": "^6.0"