From fddf3a56c6dde234edaaf3caa32e2249ef6f9260 Mon Sep 17 00:00:00 2001 From: Dave van der Brugge Date: Tue, 18 Sep 2018 23:31:04 +0200 Subject: [PATCH] Write command runners instead of "shortcuts" Eliminating the need for vendor/bin/parable and thus Parable\Framework\* In preparation of upgrading from parable to parable-php Refs #5 --- app/Command/Ui.php | 2 +- app/Config/App.php | 24 ------------------------ convert | 17 +++++++++++++++-- csv2qif | 18 +++++++++++++++--- help | 23 +++++++++++++++++++++++ validate | 17 +++++++++++++++-- 6 files changed, 69 insertions(+), 32 deletions(-) delete mode 100644 app/Config/App.php create mode 100755 help diff --git a/app/Command/Ui.php b/app/Command/Ui.php index ff6a9f9..4e8ba8b 100644 --- a/app/Command/Ui.php +++ b/app/Command/Ui.php @@ -10,7 +10,7 @@ class Ui extends Command { - protected $name = 'ui'; + protected $name = 'csv2qif'; protected $description = 'Shows a UI for convert/validate'; diff --git a/app/Config/App.php b/app/Config/App.php deleted file mode 100644 index e290b57..0000000 --- a/app/Config/App.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'commands' => [ - Convert::class, - Ui::class, - Validate::class, - ], - ], - ]; - } -} diff --git a/convert b/convert index d6c120d..38aa576 100755 --- a/convert +++ b/convert @@ -1,2 +1,15 @@ -#!/usr/bin/env bash -vendor/bin/parable convert $* +#!/usr/bin/env php +setDefaultCommand($cmd) + ->setOnlyUseDefaultCommand(true) + ->run(); diff --git a/csv2qif b/csv2qif index bf7ae79..e35a657 100755 --- a/csv2qif +++ b/csv2qif @@ -1,3 +1,15 @@ -#!/usr/bin/env bash -cd "`dirname "$0"`" -vendor/bin/parable ui +#!/usr/bin/env php +setDefaultCommand($cmd) + ->setOnlyUseDefaultCommand(true) + ->run(); diff --git a/help b/help new file mode 100755 index 0000000..f9a1761 --- /dev/null +++ b/help @@ -0,0 +1,23 @@ +#!/usr/bin/env php +setDefaultCommand($cmd) + ->setOnlyUseDefaultCommand(true) + ->addCommands([ + Container::get(Convert::class), + Container::get(Ui::class), + Container::get(Validate::class), + ]) + ->run(); diff --git a/validate b/validate index 584df63..2f0aea3 100755 --- a/validate +++ b/validate @@ -1,2 +1,15 @@ -#!/usr/bin/env bash -vendor/bin/parable validate $* +#!/usr/bin/env php +setDefaultCommand($cmd) + ->setOnlyUseDefaultCommand(true) + ->run();