diff --git a/gio/gio-tool.c b/gio/gio-tool.c index 6315b48bf..a0370485e 100644 --- a/gio/gio-tool.c +++ b/gio/gio-tool.c @@ -344,6 +344,12 @@ main (int argc, char **argv) { if (g_str_equal (command, gio_subcommands[i].name)) { + if (g_str_equal (command, "help")) + { + usage (FALSE); + return 0; + } + g_assert (gio_subcommands[i].handle_func != NULL); return gio_subcommands[i].handle_func (argc, argv, do_help); } diff --git a/gio/tests/gio-tool.py b/gio/tests/gio-tool.py index 11997c937..eaa27c892 100644 --- a/gio/tests/gio-tool.py +++ b/gio/tests/gio-tool.py @@ -56,10 +56,14 @@ class TestGioTool(testprogramrunner.TestProgramRunner): """Test the --help argument and help subcommand.""" result = self.runGio("--help") result2 = self.runGio("help") + result3 = self.runGio("help", "help") self.assertEqual(result.out, result2.out) self.assertEqual(result.err, result2.err) + self.assertEqual(result2.out, result3.out) + self.assertEqual(result2.err, result3.err) + self.assertIn("Usage:\n gio COMMAND", result.out) self.assertIn("List the contents of locations", result.out)