diff --git a/src/ncc/CLI/HelpMenu.php b/src/ncc/CLI/HelpMenu.php index 043d537..887f5d5 100644 --- a/src/ncc/CLI/HelpMenu.php +++ b/src/ncc/CLI/HelpMenu.php @@ -25,9 +25,9 @@ // TODO: Make copyright not hard-coded. print(\ncc\Utilities\Functions::getBanner(NCC_VERSION_BRANCH . ' ' . NCC_VERSION_NUMBER, 'Copyright (c) 2022-2022 Nosial', $basic_ascii) . PHP_EOL); - Console::out('Usage: ncc COMMAND [options]' . PHP_EOL); - Console::out('Alternative Usage: ncc.php --ncc-cli=COMMAND [options]' . PHP_EOL . PHP_EOL); - Console::out('Nosial Code Compiler / Project Toolkit' . PHP_EOL . PHP_EOL); + Console::out('Usage: ncc COMMAND [options]'); + Console::out('Alternative Usage: ncc.php --ncc-cli=COMMAND [options]' . PHP_EOL); + Console::out('Nosial Code Compiler / Project Toolkit' . PHP_EOL); self::displayMainOptions(); self::displayManagementCommands(); @@ -53,12 +53,11 @@ ]; $options_padding = \ncc\Utilities\Functions::detectParametersPadding($options) + 4; - Console::out('Options:' . PHP_EOL); + Console::out('Options:'); foreach($options as $option) { - Console::out(' ' . $option->toString($options_padding) . PHP_EOL); + Console::out(' ' . $option->toString($options_padding)); } - print(PHP_EOL); } /** @@ -76,12 +75,11 @@ ]; $commands_padding = \ncc\Utilities\Functions::detectParametersPadding($commands) + 2; - Console::out('Management Commands:' . PHP_EOL); + Console::out('Management Commands:'); foreach($commands as $command) { - Console::out(' ' . $command->toString($commands_padding) . PHP_EOL); + Console::out(' ' . $command->toString($commands_padding)); } - print(PHP_EOL); } /** @@ -97,12 +95,11 @@ ]; $commands_padding = \ncc\Utilities\Functions::detectParametersPadding($commands) + 2; - Console::out('Commands:' . PHP_EOL); + Console::out('Commands:'); foreach($commands as $command) { - Console::out(' ' . $command->toString($commands_padding) . PHP_EOL); + Console::out(' ' . $command->toString($commands_padding)); } - print(PHP_EOL); } /** @@ -117,11 +114,10 @@ ]; $extensions_padding = \ncc\Utilities\Functions::detectParametersPadding($extensions) + 2; - print('Extensions:' . PHP_EOL); + Console::out('Extensions:'); foreach($extensions as $command) { - print(' ' . $command->toString($extensions_padding) . PHP_EOL); + Console::out(' ' . $command->toString($extensions_padding)); } - print(PHP_EOL); } } \ No newline at end of file diff --git a/src/ncc/CLI/Main.php b/src/ncc/CLI/Main.php index b58d33e..0bf634e 100644 --- a/src/ncc/CLI/Main.php +++ b/src/ncc/CLI/Main.php @@ -29,9 +29,13 @@ switch(strtolower($args['ncc-cli'])) { default: - Console::out('Unknown command ' . strtolower($args['ncc-cli']) . PHP_EOL); + Console::out('Unknown command ' . strtolower($args['ncc-cli'])); exit(1); + case 'project': + ProjectMenu::start($args); + exit(0); + case 'credential': CredentialMenu::start($args); exit(0); @@ -44,7 +48,7 @@ } catch(Exception $e) { - Console::out('Error: ' . $e->getMessage() . ' (Code: ' . $e->getCode() . ')' . PHP_EOL); + Console::out('Error: ' . $e->getMessage() . ' (Code: ' . $e->getCode() . ')'); exit(1); } diff --git a/src/ncc/CLI/ProjectMenu.php b/src/ncc/CLI/ProjectMenu.php index a7aeeb5..04d2cca 100644 --- a/src/ncc/CLI/ProjectMenu.php +++ b/src/ncc/CLI/ProjectMenu.php @@ -120,8 +120,7 @@ Console::out('Options:' . PHP_EOL); foreach($options as $option) { - Console::out(' ' . $option->toString($options_padding) . PHP_EOL); + Console::out(' ' . $option->toString($options_padding)); } - print(PHP_EOL); } } \ No newline at end of file diff --git a/src/ncc/Managers/ProjectManager.php b/src/ncc/Managers/ProjectManager.php index 86cbb25..e450273 100644 --- a/src/ncc/Managers/ProjectManager.php +++ b/src/ncc/Managers/ProjectManager.php @@ -17,23 +17,23 @@ /** * The selected directory for managing the project * - * @var string + * @var string|null */ - private string $SelectedDirectory; + private ?string $SelectedDirectory; /** * The path that points to the project's main project.json file * - * @var string + * @var string|null */ - private string $ProjectFilePath; + private ?string $ProjectFilePath; /** * The path that points the project's main directory * - * @var string + * @var string|null */ - private string $ProjectPath; + private ?string $ProjectPath; /** * Public Constructor