summaryrefslogtreecommitdiff
path: root/futility/cmd_foo.c
diff options
context:
space:
mode:
Diffstat (limited to 'futility/cmd_foo.c')
-rw-r--r--futility/cmd_foo.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/futility/cmd_foo.c b/futility/cmd_foo.c
new file mode 100644
index 00000000..e02a9ffb
--- /dev/null
+++ b/futility/cmd_foo.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <stdio.h>
+
+#include "futility.h"
+
+static int do_something(int argc, char *argv[])
+{
+ int i;
+ printf("this is %s\n", __func__);
+ for (i = 0; i < argc; i++)
+ printf("argv[%d] = %s\n", i, argv[i]);
+ return 0;
+}
+
+DECLARE_FUTIL_COMMAND(foo, do_something, "invoke a foo");
+DECLARE_FUTIL_COMMAND(bar, do_something, "go to bar");
+DECLARE_FUTIL_COMMAND(hey, do_something, "shout");