PHP code example of adeptoas / sweet-cli

1. Go to this page and download the library: Download adeptoas/sweet-cli library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

adeptoas / sweet-cli example snippets


   #!/usr/bin/env php
   
   

    

   $app = new Application(__FILE__);
   

   $app->addSubCommand(SomeSubCommand::class);
   $app->addSubCommand(SomeOtherSubCommand::class);
   

   $app->addAlias('npm');
   $app->addAlias('php', '/usr/local/bin/php');
   

checkConflictingOptions()

hasDuplicateBoolean(bool $bool, array $values): bool

hasOptions(): bool

hasOption(string $option): bool

getOption(string $option): mixed

setOption(string $option, mixed $value)



getApp(): CLIApplication