Skip to content
Permalink
Browse files
feat(cli/modules): Added the modules flag -m to hhvms cli
Summary: feat(cli/modules):

Added the --modules flag to the cli, +1 towards feature parity with the zend cli.
Closes #6270

Reviewed By: @jwatzman

Differential Revision: D2459135

fb-gh-sync-id: bf68023457263ef91fe54a6b7e2a17836145abef
  • Loading branch information
kaustavha authored and hhvm-bot committed Oct 13, 2015
1 parent ee81ae8 commit 5a2fad570d64bb0c0f63286e1c76262a968c2ee2
Showing 2 changed files with 16 additions and 0 deletions.
@@ -124,6 +124,13 @@ int emulate_zend(int argc, char** argv) {
need_file = false;
break;
}
if (strcmp(argv[cnt], "--modules") == 0) {
// zend has a -m flag but we're already using it for --mode
newargv.push_back("--modules");
cnt = argc; // no need to check the rest of options and arguments
need_file = false;
break;
}
if (strcmp(argv[cnt], "-f") == 0 || strcmp(argv[cnt], "--file") == 0) {
cnt++;
newargv.push_back(lint ? "-l" : "-f");
@@ -1269,6 +1269,7 @@ static int execute_program_impl(int argc, char** argv) {
desc.add_options()
("help", "display this message")
("version", "display version number")
("modules", "display modules")
("php", "emulate the standard php command line")
("compiler-id", "display the git hash for the compiler")
("repo-schema", "display the repository schema id")
@@ -1454,6 +1455,14 @@ static int execute_program_impl(int argc, char** argv) {
cout << "Repo schema: " << kRepoSchemaId << "\n";
return 0;
}
if (vm.count("modules")) {
Array exts = ExtensionRegistry::getLoaded();
cout << "[PHP Modules]" << "\n";
for (ArrayIter iter(exts); iter; ++iter) {
cout << iter.second().toString().toCppString() << "\n";
}
return 0;
}
if (vm.count("compiler-id")) {
cout << kCompilerId << "\n";
return 0;

0 comments on commit 5a2fad5

Please sign in to comment.