summaryrefslogtreecommitdiff
path: root/src/ostree/ot-main.c
diff options
context:
space:
mode:
authorMatthew Leeds <matthew.leeds@endlessm.com>2017-08-04 13:18:40 -0700
committerAtomic Bot <atomic-devel@projectatomic.io>2017-08-05 00:55:36 +0000
commit5682f4cc041d1b53448739f8656ed6fd120e7dbe (patch)
tree782103480274c52984bfd8bfc028c53c58909148 /src/ostree/ot-main.c
parent4e068f3924f57f7a4a26a91aab38c725520251fe (diff)
downloadostree-5682f4cc041d1b53448739f8656ed6fd120e7dbe.tar.gz
main: Fix subcommand usage output
This commit sets prgname correctly so that the "ostree subcommand --help" output prints the subcommand rather than just "ostree". This was removed in commit f0519e541f29 because it tripped the thread sanitizer, but it's being added back conditionally so most users who don't compile with -fsanitize=adress see proper help output. Closes: #1054 Approved by: cgwalters
Diffstat (limited to 'src/ostree/ot-main.c')
-rw-r--r--src/ostree/ot-main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index 56d247b4..5b6e301d 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -117,6 +117,9 @@ ostree_run (int argc,
OstreeCommand *command;
GError *error = NULL;
GCancellable *cancellable = NULL;
+#ifndef BUILDOPT_TSAN
+ g_autofree char *prgname = NULL;
+#endif
const char *command_name = NULL;
gboolean success = FALSE;
int in, out;
@@ -192,6 +195,11 @@ ostree_run (int argc,
goto out;
}
+#ifndef BUILDOPT_TSAN
+ prgname = g_strdup_printf ("%s %s", g_get_prgname (), command_name);
+ g_set_prgname (prgname);
+#endif
+
if (!command->fn (argc, argv, cancellable, &error))
goto out;