[game-data-packager] 10/20: Print help after failing to make a package

Simon McVittie smcv at debian.org
Mon Jan 12 01:07:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch master
in repository game-data-packager.

commit ef40807f0889177072869d18c54b30da72e18aff
Author: Simon McVittie <smcv at debian.org>
Date:   Sun Jan 11 19:26:41 2015 +0000

    Print help after failing to make a package
    
    It often mentions how to get the files.
---
 lib/game_data_packager/__init__.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/game_data_packager/__init__.py b/lib/game_data_packager/__init__.py
index 537769f..9efc9ef 100644
--- a/lib/game_data_packager/__init__.py
+++ b/lib/game_data_packager/__init__.py
@@ -301,6 +301,8 @@ class GameData(object):
         self.yaml = yaml.load(open(os.path.join(DATADIR,
             shortname + '.yaml')))
 
+        self.argument_parser = None
+
         if 'longname' in self.yaml:
             self.longname = self.yaml['longname']
 
@@ -1112,6 +1114,7 @@ class GameData(object):
                             + 'version are available')
                 break
 
+        self.argument_parser = parser
         return parser
 
     def run_command_line(self, args):
@@ -1172,6 +1175,7 @@ class GameData(object):
                                 package.name)
                         possible.add(package)
                     else:
+                        self.argument_parser.print_help()
                         raise SystemExit(1)
             else:
                 # If no demo, repeat the process for the first
@@ -1184,8 +1188,10 @@ class GameData(object):
                                     'a bug', package.name)
                             possible.add(package)
                         else:
+                            self.argument_parser.print_help()
                             sys.exit(1)
                 else:
+                    self.argument_parser.print_help()
                     raise SystemExit('Unable to complete any packages. ' +
                             'Please provide more files or directories.')
 
@@ -1212,6 +1218,7 @@ class GameData(object):
                         package.name)
 
         if not ready:
+            self.argument_parser.print_help()
             raise SystemExit(1)
 
         debs = set()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list