# HG changeset patch # User jruigrok # Date 1270974540 0 # Node ID 0385e2aecbaa29cbfee41078b96041e6a97e0dc9 # Parent eab2fceb8ab0ca1754ad6bd8d277da64baa44333 Merged revisions 466 via svnmerge from http://svn.edgewall.org/repos/babel/trunk ........ r466 | palgarvio | 2008-12-23 02:12:59 +0100 (di, 23 dec 2008) | 2 lines Use a more explicit error message if no option or argument(command) is passed to `pybabel`. Fixes #81. ........ diff --git a/0.9.x/ChangeLog b/0.9.x/ChangeLog --- a/0.9.x/ChangeLog +++ b/0.9.x/ChangeLog @@ -8,6 +8,8 @@ * Sort output of list-locales. * Make the POT-Creation-Date of the catalog being updated equal to POT-Creation-Date of the template used to update (ticket #148). + * Use a more explicit error message if no option or argument (command) is + passed to pybabel (ticket #81). Version 0.9.5 diff --git a/0.9.x/babel/messages/frontend.py b/0.9.x/babel/messages/frontend.py --- a/0.9.x/babel/messages/frontend.py +++ b/0.9.x/babel/messages/frontend.py @@ -648,7 +648,8 @@ return 0 if not args: - self.parser.error('incorrect number of arguments') + self.parser.error('no valid command or option passed. ' + 'Try the -h/--help option for more information.') cmdname = args[0] if cmdname not in self.commands: diff --git a/0.9.x/babel/messages/tests/frontend.py b/0.9.x/babel/messages/tests/frontend.py --- a/0.9.x/babel/messages/tests/frontend.py +++ b/0.9.x/babel/messages/tests/frontend.py @@ -529,7 +529,7 @@ self.assertEqual("""\ usage: pybabel command [options] [args] -pybabel: error: incorrect number of arguments +pybabel: error: no valid command or option passed. try the -h/--help option for more information. """, sys.stderr.getvalue().lower()) def test_help(self):