<?php
namespace nur\mapper\item;

use nur\mapper\base\mappers_command;
use nur\mapper\base\Tparams_command;

/**
 * Class NumberMapper_command: classe de support pour construire une instance de
 * mapper pour une application recevant des commandes utilisateurs
 */
class NumberMapper_command {
  use Tparams_command;

  const NAME = "number";
  const DEF = [self::NAME, "num", 
    "help" => "faire des opérations sur des nombres",
    "action" => [self::class, "create_command"],
    "cmd_args" => [
      "usage" => self::NAME,
      ["-o", "--param", "args" => "value",
        "action" => [self::class, "add_params"],
        "help" => "spécifier une option générique",
      ],
    ],
  ];

  /** @var NumberMapper */
  protected static $command;

  static function create_command() {
    self::$command = mappers_command::add(new NumberMapper());
  }
}
