From 6f1f78fc33c34fa240b5d0254b4d3ee9184eb2f5 Mon Sep 17 00:00:00 2001 From: norb Date: Mon, 30 Mar 2026 16:56:15 +0200 Subject: [PATCH 1/3] feat: add shortOption to siteDir --- bin/cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cfg b/bin/cfg index 5c2203c..ac69102 100755 --- a/bin/cfg +++ b/bin/cfg @@ -105,7 +105,7 @@ $collection = (new Input\InputCollection()) ->description('Path where the config/ directory of the package conf files is located, defaults to the working dir') ) // }}} - ->add( Input\InputTypeFactory::build('LongOption')->name('siteDir') // {{{ + ->add( Input\InputTypeFactory::build('LongOption')->name('siteDir')->short('s') // {{{ ->flags(AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_VALUE_REQUIRED) ->description('Site/instance directory below config/. Accepts owner_xyz or config/owner_xyz') ->validator(new Input\Validator( From f87ada6c15c16fafae08b337c4986aa1e61b1058 Mon Sep 17 00:00:00 2001 From: norb Date: Mon, 30 Mar 2026 16:56:40 +0200 Subject: [PATCH 2/3] fix: remove commented code --- bin/cfg | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/bin/cfg b/bin/cfg index ac69102..7a1e253 100755 --- a/bin/cfg +++ b/bin/cfg @@ -320,16 +320,6 @@ $appPath = $argv->find('appPath'); if (!$appPath) $appPath = getcwd().'/'; $appPath = rtrim($appPath, '/').'/'; -/* $it = new RecursiveDirectoryIterator($appPath); - -foreach(new RecursiveIteratorIterator($it) as $file) -{ - $configDir = $file->getPath(); - if ($file->isDir() && $file->getFilename() == '.' && basename($configDir) == 'config') { - echo "found config dir: $configDir\n"; - } -} - */ $mode = ($argv->find('mode') == '') ? null : $argv->find('mode'); $cfg = (new Settings([], $mode))->appPath($appPath)->prefix($prefix); // pkgPath points to package defaults (e.g. .default.conf.php) From 56872a04c497efdd66a22d234cf0de760328cd80 Mon Sep 17 00:00:00 2001 From: norb Date: Mon, 30 Mar 2026 16:57:58 +0200 Subject: [PATCH 3/3] style: fix indentation --- bin/cfg | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/bin/cfg b/bin/cfg index 7a1e253..0f8f200 100755 --- a/bin/cfg +++ b/bin/cfg @@ -379,21 +379,22 @@ case 'show': echo $out.PHP_EOL; break; - case 'write': - $inputPayload = $argv->find('in'); - if (!$inputPayload && $settings['key'] === '') - { - fwrite(STDERR, 'Nothing to write: provide SETTING or --in.'.PHP_EOL); - exit(1); - } - $path = ($settings['key'] !== '') ? explode(':', $settings['key']) : []; - verboseLog($verbose, 'write source: '.($inputPayload ? '--in' : 'SETTING')); - if ($inputPayload) - { - $setting2write = $inputPayload; - } - else - { +case 'write': + $inputPayload = $argv->find('in'); + if (!$inputPayload && $settings['key'] === '') + { + fwrite(STDERR, 'Nothing to write: provide SETTING or --in.'.PHP_EOL); + exit(1); + } + $path = ($settings['key'] !== '') ? explode(':', $settings['key']) : []; + verboseLog($verbose, 'write source: '.($inputPayload ? '--in' : 'SETTING')); + + if ($inputPayload) + { + $setting2write = $inputPayload; + } + else + { $setting2write = $settings['value']; } verboseLog($verbose, 'write path: '.json_encode($path));