Skip to content

Commit

Permalink
Show usage info when no params are passed
Browse files Browse the repository at this point in the history
  • Loading branch information
sanikolaev committed Jan 3, 2025
1 parent 42e8709 commit fa9c4cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class Configuration implements ArrayAccess {
* @param array|null $argv Command line arguments (uses global $argv if null)
*/
public function __construct($argv = null) {
// Get basename of the script name to handle both 'manticore-load' and './manticore-load'
if (count($argv) === 1 and basename($argv[0]) === 'manticore-load') {
fwrite(STDERR, "Usage: manticore-load [options] [--together [options]...]\n");
exit(1);
}

if ($argv === null) {
global $argv;
}
Expand Down

0 comments on commit fa9c4cb

Please sign in to comment.