diff --git a/gpio-util/argument.cpp b/gpio-util/argument.cpp
new file mode 100644
index 0000000..222b7d3
--- /dev/null
+++ b/gpio-util/argument.cpp
@@ -0,0 +1,95 @@
+/**
+ * Copyright © 2017 IBM Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <iostream>
+#include <iterator>
+#include <algorithm>
+#include "argument.hpp"
+
+namespace phosphor
+{
+namespace gpio
+{
+
+ArgumentParser::ArgumentParser(int argc, char** argv)
+{
+    int option = 0;
+    while (-1 != (option = getopt_long(argc, argv, optionStr, options, NULL)))
+    {
+        if ((option == '?') || (option == 'h'))
+        {
+            usage(argv);
+            exit(-1);
+        }
+
+        auto i = &options[0];
+        while ((i->val != option) && (i->val != 0))
+        {
+            ++i;
+        }
+
+        if (i->val)
+        {
+            arguments[i->name] = (i->has_arg ? optarg : trueString);
+        }
+    }
+}
+
+const std::string& ArgumentParser::operator[](const std::string& opt)
+{
+    auto i = arguments.find(opt);
+    if (i == arguments.end())
+    {
+        return emptyString;
+    }
+    else
+    {
+        return i->second;
+    }
+}
+
+void ArgumentParser::usage(char** argv)
+{
+    std::cerr << "Usage: " << argv[0] << " [options]\n";
+    std::cerr << "Options:\n";
+    std::cerr << "    --help            Print this menu.\n";
+    std::cerr << "    --gpio=<gpio>     The GPIO number.  Example: 1\n";
+    std::cerr << "    --path=<path>     The path to the GPIO device."
+                                        "  Example: /dev/gpiochip0\n";
+    std::cerr << "    --delay=<delay>   The delay in ms in between a toggle."
+                                        "  Example: 5\n";
+    std::cerr << "    --action=<action> The action to do.\n";
+    std::cerr << "                      Valid actions: low, high, low_high, "
+                                        "high_low\n";
+    std::cerr << std::flush;
+}
+
+const option ArgumentParser::options[] =
+{
+    { "action", required_argument, NULL, 'a' },
+    { "gpio",   required_argument, NULL, 'g' },
+    { "delay",  required_argument, NULL, 'd' },
+    { "path",   required_argument, NULL, 'p' },
+    { "help",   no_argument,       NULL, 'h' },
+    { 0, 0, 0, 0},
+};
+
+const char* ArgumentParser::optionStr = "a:g:d:p:h?";
+
+const std::string ArgumentParser::trueString = "true";
+const std::string ArgumentParser::emptyString = "";
+
+}
+}
