diff --git a/src/ncc/CLI/HelpMenu.php b/src/ncc/CLI/HelpMenu.php index e29daed..289b85d 100644 --- a/src/ncc/CLI/HelpMenu.php +++ b/src/ncc/CLI/HelpMenu.php @@ -3,7 +3,6 @@ namespace ncc\CLI; use ncc\Objects\CliHelpSection; - use ncc\Utilities\Resolver; class HelpMenu { @@ -15,7 +14,8 @@ */ public static function start($argv) { - print('Usage: ncc [options] COMMAND' . PHP_EOL . PHP_EOL); + print('Usage: ncc COMMAND [options]' . PHP_EOL); + print('Alternative Usage: ncc.php --ncc-cli=COMMAND [options]' . PHP_EOL . PHP_EOL); print('Nosial Code Compiler / Project Toolkit' . PHP_EOL . PHP_EOL); self::displayMainOptions(); @@ -38,9 +38,7 @@ new CliHelpSection(['-l', '--log-level={debug|info|warn|error|fatal}'], 'Set the logging level', 'info'), new CliHelpSection(['--basic-ascii'], 'Uses basic ascii characters'), new CliHelpSection(['--no-color'], 'Omits the use of colors'), - new CliHelpSection(['--no-banner'], 'Omits displaying the NCC ascii banner'), - new CliHelpSection(['--no-ui'], 'Omits displaying a user-interface for wizards/dialogs'), - new CliHelpSection(['--require-scope={user|system}'], 'Enforces the requirement of a access scope', 'user'), + new CliHelpSection(['--no-banner'], 'Omits displaying the NCC ascii banner') ]; $options_padding = \ncc\Utilities\Functions::detectParametersPadding($options) + 4; diff --git a/src/ncc/CLI/Main.php b/src/ncc/CLI/Main.php index 769f230..92754bc 100644 --- a/src/ncc/CLI/Main.php +++ b/src/ncc/CLI/Main.php @@ -18,22 +18,40 @@ if(isset($args['ncc-cli'])) { - $banner = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'banner_extended'); + // Initialize NCC + \ncc\ncc::initialize(); - $banner_version = 'Master 1.0.0'; - $banner_version = str_pad($banner_version, 21); + if(isset($args['no-banner']) == false) + { + if(isset($args['basic-ascii'])) + { + $banner = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'banner_basic'); + } + else + { + $banner = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'banner_extended'); + } - $banner_copyright = 'Copyright (c) 2022-2022 Nosial'; - $banner_copyright = str_pad($banner_copyright, 30); - - $banner = str_ireplace('%A', $banner_version, $banner); - $banner = str_ireplace('%B', $banner_copyright, $banner); - - print($banner . PHP_EOL); + $banner_version = NCC_VERSION_BRANCH . ' ' . NCC_VERSION_NUMBER; + $banner_version = str_pad($banner_version, 21); + + $banner_copyright = 'Copyright (c) 2022-2022 Nosial'; + $banner_copyright = str_pad($banner_copyright, 30); + + $banner = str_ireplace('%A', $banner_version, $banner); + $banner = str_ireplace('%B', $banner_copyright, $banner); + + print($banner . PHP_EOL); + } + switch(strtolower($args['ncc-cli'])) { default: + print('Unknown command ' . strtolower($args['ncc-cli']) . PHP_EOL); + exit(1); + + case '1': case 'help': HelpMenu::start($argv); exit(0); diff --git a/src/ncc/meta.json b/src/ncc/meta.json deleted file mode 100644 index 680b222..0000000 --- a/src/ncc/meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": "1.0.0", - "branch": "master", - "flags": ["UNSTABLE"], - "update_source": null -} \ No newline at end of file diff --git a/src/ncc/ncc.php b/src/ncc/ncc.php index 673ec45..0e8a414 100644 --- a/src/ncc/ncc.php +++ b/src/ncc/ncc.php @@ -42,7 +42,7 @@ try { - self::$VersionInformation = \ncc\Objects\NccVersionInformation::fromArray(\ncc\Utilities\Functions::loadJsonFile(__DIR__ . DIRECTORY_SEPARATOR . 'version.json')); + self::$VersionInformation = \ncc\Objects\NccVersionInformation::fromArray(\ncc\Utilities\Functions::loadJsonFile(__DIR__ . DIRECTORY_SEPARATOR . 'version.json', \ncc\Utilities\Functions::FORCE_ARRAY)); } catch(\ncc\Exceptions\MalformedJsonException $e) {