Arquivos
hhvm/hphp/runtime/eval/debugger/cmd/new_cmd.php
T
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08:00

20 linhas
632 B
PHP

<?php
isset($argv[1]) || die("missing {name}:\n\tphp new_cmd.php {name}\n");
$NAME = strtoupper($Name = ucfirst($name = strtolower($argv[1])));
foreach (array('h', 'cpp') as $ext) {
exec("cp -f cmd.$ext.template cmd_$name.$ext");
foreach (array('machine' => $name, 'Machine' => $Name, 'MACHINE' => $NAME)
as $from => $to) {
exec("perl -p -i -n -e 's/$from/$to/g' cmd_$name.$ext");
}
}
if (!isset($argv[2])) {
$include = "#include <runtime/eval/debugger/cmd/cmd_$name.h>";
exec("perl -p -i -n -e 's!$include\n!!sg' all.h");
exec("perl -p -i -n -e 's!^(//tag: new_cmd\.php.*)$!$include\n$1!' all.h");
}