summaryrefslogtreecommitdiff
path: root/src/ostree/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ostree/main.c')
-rw-r--r--src/ostree/main.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/ostree/main.c b/src/ostree/main.c
index 0e47ede3..7d17080c 100644
--- a/src/ostree/main.c
+++ b/src/ostree/main.c
@@ -26,7 +26,6 @@
#include <errno.h>
#include <string.h>
#include <unistd.h>
-#include <locale.h>
#include "ot-main.h"
#include "ot-builtins.h"
@@ -131,22 +130,16 @@ int
main (int argc,
char **argv)
{
- g_autoptr(GError) error = NULL;
- int ret;
+ g_assert (argc > 0);
- setlocale (LC_ALL, "");
-
- g_set_prgname (argv[0]);
-
- ret = ostree_run (argc, argv, commands, &error);
-
- if (error != NULL)
+ g_autofree gchar *ext_command = ostree_command_lookup_external (argc, argv, commands);
+ if (ext_command != NULL)
{
- g_printerr ("%s%serror:%s%s %s\n",
- ot_get_red_start (), ot_get_bold_start (),
- ot_get_bold_end (), ot_get_red_end (),
- error->message);
+ argv[0] = ext_command;
+ return ostree_command_exec_external (argv);
+ }
+ else
+ {
+ return ostree_main (argc, argv, commands);
}
-
- return ret;
}