summaryrefslogtreecommitdiff
path: root/src/libotutil/ot-opt-utils.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2011-11-02 13:22:13 -0400
committerColin Walters <walters@verbum.org>2011-11-02 13:22:13 -0400
commit2b00cf381076bb72557f9721dbc3ca8dc2940440 (patch)
treec5a0899716b6132f47c515c20b314fc790d3f6ae /src/libotutil/ot-opt-utils.c
parent796dc7fc57add1743934af53955a65ef7520b950 (diff)
downloadostree-2b00cf381076bb72557f9721dbc3ca8dc2940440.tar.gz
core: add ^ for rev-parse
Diffstat (limited to 'src/libotutil/ot-opt-utils.c')
-rw-r--r--src/libotutil/ot-opt-utils.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/libotutil/ot-opt-utils.c b/src/libotutil/ot-opt-utils.c
new file mode 100644
index 00000000..54d107c8
--- /dev/null
+++ b/src/libotutil/ot-opt-utils.c
@@ -0,0 +1,37 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2011 Colin Walters <walters@verbum.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: Colin Walters <walters@verbum.org>
+ */
+
+#include "config.h"
+
+#include <gio/gio.h>
+
+#include <string.h>
+
+#include "otutil.h"
+
+void
+ot_util_usage_error (GOptionContext *context, const char *message, GError **error)
+{
+ gchar *help = g_option_context_get_help (context, TRUE, NULL);
+ g_printerr ("%s\n", help);
+ g_free (help);
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, message);
+}