diff --git a/buffet/buffet.gyp b/buffet/buffet.gyp
index f44d8dc..63d8d62 100644
--- a/buffet/buffet.gyp
+++ b/buffet/buffet.gyp
@@ -13,19 +13,11 @@
         'libcurl',
       ],
     },
-    # TODO(sosa): Remove gflags: crbug.com/356745.
-    'link_settings': {
-      'libraries': [
-        '-lgflags',
-      ],
-    },
     'include_dirs': [
       '..'  # To access all src/platform2 directories
     ],
-    # TODO(sosa): Remove no-strict-aliasing: crbug.com/356745.
     'cflags_cc': [
       '-std=gnu++11',
-      '-fno-strict-aliasing',
     ],
   },
   'targets': [
diff --git a/buffet/buffet_client.cc b/buffet/buffet_client.cc
index 9568834..edd6e87 100755
--- a/buffet/buffet_client.cc
+++ b/buffet/buffet_client.cc
@@ -5,11 +5,13 @@
 #include <iostream>
 #include <string>
 
+#include <base/command_line.h>
 #include <base/logging.h>
 #include <base/memory/scoped_ptr.h>
 #include <dbus/bus.h>
 #include <dbus/object_proxy.h>
 #include <dbus/message.h>
+#include <sysexits.h>
 
 #include "buffet/dbus_constants.h"
 #include "buffet/dbus_manager.h"
@@ -97,53 +99,59 @@
 } // namespace
 
 int main(int argc, char** argv) {
+  CommandLine::Init(argc, argv);
+  CommandLine* cl = CommandLine::ForCurrentProcess();
+
   dbus::Bus::Options options;
   options.bus_type = dbus::Bus::SYSTEM;
   scoped_refptr<dbus::Bus> bus(new dbus::Bus(options));
 
-  if (argc < 2) {
+  CommandLine::StringVector args = cl->GetArgs();
+  if (args.size() < 1) {
     usage();
-    return -1;
+    return EX_USAGE;
   }
 
-  char* command = argv[1];
+  // Pop the command off of the args list.
+  std::string command = args[0];
+  args.erase(args.begin());
   bool success = false;
-  if (strcmp(command, kRootTestMethod) == 0) {
+  if (command.compare(kRootTestMethod) == 0) {
     auto proxy = GetBuffetDBusProxy(
         bus, buffet::dbus_constants::kRootServicePath);
     success = CallTestMethod(proxy);
-  } else if (strcmp(command, kManagerRegisterDeviceMethod) == 0) {
-    if (argc != 5) {
+  } else if (command.compare(kManagerRegisterDeviceMethod) == 0) {
+    if (args.size() != 3) {
       std::cerr << "Invalid number of arguments for "
                 << "Manager.RegisterDevice" << std::endl;
       usage();
-      return -1;
+      return EX_USAGE;
     }
     auto proxy = GetBuffetDBusProxy(
         bus, buffet::dbus_constants::kManagerServicePath);
-    success = CallManagerRegisterDevice(proxy, argv[2], argv[3], argv[4]);
-  } else if (strcmp(command, kManagerUpdateStateMethod) == 0) {
-    if (argc != 3) {
+    success = CallManagerRegisterDevice(proxy, args[0], args[1], args[2]);
+  } else if (command.compare(kManagerUpdateStateMethod) == 0) {
+    if (args.size() != 1) {
       std::cerr << "Invalid number of arguments for "
                 << "Manager.UpdateState" << std::endl;
       usage();
-      return -1;
+      return EX_USAGE;
     }
     auto proxy = GetBuffetDBusProxy(
         bus, buffet::dbus_constants::kManagerServicePath);
-    success = CallManagerUpdateState(proxy, argv[2]);
+    success = CallManagerUpdateState(proxy, args[0]);
   } else {
-    std::cerr << "Unkown command: " << command << std::endl;
+    std::cerr << "Unknown command: " << command << std::endl;
     usage();
-    return -1;
+    return EX_USAGE;
   }
 
   if (success) {
     std::cout << "Done." << std::endl;
-    return 0;
+    return EX_OK;
   }
 
-  std::cout << "Done, with errors." << std::endl;
-  return -1;
+  std::cerr << "Done, with errors." << std::endl;
+  return 1;
 }
 
diff --git a/buffet/main.cc b/buffet/main.cc
index 79843ab..37a9031 100644
--- a/buffet/main.cc
+++ b/buffet/main.cc
@@ -12,15 +12,23 @@
 #include <base/message_loop/message_loop.h>
 #include <base/strings/string_util.h>
 #include <base/strings/stringprintf.h>
-#include <gflags/gflags.h>
+#include <sysexits.h>
 
 #include "buffet/dbus_manager.h"
 #include "buffet/manager.h"
 
-DEFINE_string(logsroot, "/var/log", "Root directory for buffet logs.");
-
 namespace {
 
+static const char kLogRoot[] = "logroot";
+static const char kHelp[] = "help";
+static const char kDefaultLogRoot[] = "/var/log";
+
+// The help message shown if help flag is passed to the program.
+static const char kHelpMessage[] = "\n"
+    "Available Switches: \n"
+    "  --logroot=/path/to/logroot\n"
+    "    Specifies parent directory to put buffet logs in.\n";
+
 // Returns |utime| as a string
 std::string GetTimeAsString(time_t utime) {
   struct tm tm;
@@ -40,10 +48,10 @@
   }
 }
 
-// Creates new log file based on timestamp in |logs_root|/buffet.
-std::string SetupLogFile(const std::string& logs_root) {
-  const auto log_symlink = logs_root + "/buffet.log";
-  const auto logs_dir = logs_root + "/buffet";
+// Creates new log file based on timestamp in |log_root|/buffet.
+std::string SetupLogFile(const std::string& log_root) {
+  const auto log_symlink = log_root + "/buffet.log";
+  const auto logs_dir = log_root + "/buffet";
   const auto log_path =
       base::StringPrintf("%s/buffet.%s",
                          logs_dir.c_str(),
@@ -54,8 +62,8 @@
 }
 
 // Sets up logging for buffet.
-void SetupLogging(const std::string& logs_root) {
-  const auto log_file = SetupLogFile(logs_root);
+void SetupLogging(const std::string& log_root) {
+  const auto log_file = SetupLogFile(log_root);
   logging::LoggingSettings settings;
   settings.logging_dest = logging::LOG_TO_ALL;
   settings.log_file = log_file.c_str();
@@ -69,10 +77,19 @@
 int main(int argc, char* argv[]) {
   // Parse the args and check for extra args.
   CommandLine::Init(argc, argv);
-  google::ParseCommandLineFlags(&argc, &argv, true);
-  CHECK_EQ(argc, 1) << "Unexpected arguments. Try --help";
+  CommandLine* cl = CommandLine::ForCurrentProcess();
 
-  SetupLogging(FLAGS_logsroot);
+  if (cl->HasSwitch(kHelp)) {
+    LOG(INFO) << kHelpMessage;
+    return EX_USAGE;
+  }
+
+  std::string log_root = std::string(kDefaultLogRoot);
+  if (cl->HasSwitch(kLogRoot)) {
+    log_root = cl->GetSwitchValueASCII(kLogRoot);
+  }
+
+  SetupLogging(log_root);
 
   base::AtExitManager at_exit_manager;
   base::MessageLoopForIO message_loop;
@@ -87,5 +104,5 @@
   }
 
   dbus_manager.Finalize();
-  return 0;
+  return EX_OK;
 }
