PHP code example of hongye / rc-cmd

1. Go to this page and download the library: Download hongye/rc-cmd 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/ */

    

hongye / rc-cmd example snippets

 php
#!/usr/bin/env php


namespace Ruochen\Tools;

use League\CLImate\CLImate;
use Ruochen\Annotations\Command;
use Ruochen\Annotations\Desc;
use Ruochen\Annotations\Operand;
use Ruochen\Annotations\Option;
use Ruochen\Foundation\CommandTool;
use Ruochen\Helpers\ANSIHelper;
/**
 * Class SampleTool
 * @package Examples
 * @Option(short="d",long="database",desc="select one database",mode="f",long="filter",mode="', ANSIHelper::colorWrap('UNKOWN', ANSIHelper::FG_YELLOW),
        ];
        $cli->columns($outTables);
    }


    /**
     * @Command("dp")
     * @Desc("dump all data")
     */
    public function dump(){
        $this->logger->info("dump.....");
    }
}

$sampleTool = SampleTool::getInstance();

$sampleTool->process();