Hoa central
Uuid.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Core\Bin;
38 
39 use Hoa\Console;
40 use Hoa\Core;
41 
51 {
57  protected $options = [
58  ['help', Console\GetOption::NO_ARGUMENT, 'h'],
59  ['help', Console\GetOption::NO_ARGUMENT, '?']
60  ];
61 
62 
63 
69  public function main()
70  {
71  while (false !== $c = $this->getOption($v)) {
72  switch ($c) {
73  case 'h':
74  case '?':
75  return $this->usage();
76 
77  case '__ambiguous':
78  $this->resolveOptionAmbiguity($v);
79 
80  break;
81  }
82  }
83 
84  echo Core::uuid(), "\n";
85 
86  return;
87  }
88 
94  public function usage()
95  {
96  echo
97  'Usage : core:uuid <options>', "\n",
98  'Options :', "\n",
99  $this->makeUsageOptionsList([
100  'help' => 'This help.'
101  ]), "\n";
102 
103  return;
104  }
105 }
106 
107 __halt_compiler();
108 Generate an Universal Unique Identifier (UUID).
makeUsageOptionsList(Array $definitions=[])
Definition: Kit.php:149
static uuid()
Definition: Core.php:444
getOption(&$optionValue, $short=null)
Definition: Kit.php:104
resolveOptionAmbiguity(Array $solutions)
Definition: Kit.php:190