osquery-1/osquery/main/shell.cpp
2015-02-03 14:59:32 -08:00

31 lines
914 B
C++

/*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#include <osquery/core.h>
#include <osquery/database.h>
#include <osquery/devtools.h>
#include <osquery/events.h>
int main(int argc, char *argv[]) {
osquery::FLAGS_db_path = "/tmp/rocksdb-osquery-shell";
// Parse/apply flags, start registry, load logger/config plugins.
osquery::initOsquery(argc, argv, osquery::OSQUERY_TOOL_SHELL);
// Start event threads.
osquery::EventFactory::delay();
// Virtual tables will be attached to the shell's in-memory SQLite DB.
int retcode = osquery::launchIntoShell(argc, argv);
// Finally shutdown.
osquery::shutdownOsquery();
return retcode;
}