diff options
Diffstat (limited to 'subcmds/manifest.py')
| -rw-r--r-- | subcmds/manifest.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/subcmds/manifest.py b/subcmds/manifest.py index 4374a9d0..4415b99e 100644 --- a/subcmds/manifest.py +++ b/subcmds/manifest.py | |||
| @@ -18,13 +18,22 @@ import sys | |||
| 18 | 18 | ||
| 19 | from command import PagedCommand | 19 | from command import PagedCommand |
| 20 | 20 | ||
| 21 | def _doc(name): | ||
| 22 | r = os.path.dirname(__file__) | ||
| 23 | r = os.path.dirname(r) | ||
| 24 | fd = open(os.path.join(r, 'docs', 'manifest_xml.txt')) | ||
| 25 | try: | ||
| 26 | return fd.read() | ||
| 27 | finally: | ||
| 28 | fd.close() | ||
| 29 | |||
| 21 | class Manifest(PagedCommand): | 30 | class Manifest(PagedCommand): |
| 22 | common = False | 31 | common = False |
| 23 | helpSummary = "Manifest inspection utility" | 32 | helpSummary = "Manifest inspection utility" |
| 24 | helpUsage = """ | 33 | helpUsage = """ |
| 25 | %prog [-o {-|NAME.xml} [-r]] | 34 | %prog [-o {-|NAME.xml} [-r]] |
| 26 | """ | 35 | """ |
| 27 | _helpDescription = """ | 36 | _xmlHelp = """ |
| 28 | 37 | ||
| 29 | With the -o option, exports the current manifest for inspection. | 38 | With the -o option, exports the current manifest for inspection. |
| 30 | The manifest and (if present) local_manifest.xml are combined | 39 | The manifest and (if present) local_manifest.xml are combined |
| @@ -35,13 +44,9 @@ in a Git repository for use during future 'repo init' invocations. | |||
| 35 | 44 | ||
| 36 | @property | 45 | @property |
| 37 | def helpDescription(self): | 46 | def helpDescription(self): |
| 38 | help = self._helpDescription + '\n' | 47 | help = '' |
| 39 | r = os.path.dirname(__file__) | 48 | if isinstance(self.manifest, XmlManifest): |
| 40 | r = os.path.dirname(r) | 49 | help += self._xmlHelp + '\n' + _doc('manifest_xml.txt') |
| 41 | fd = open(os.path.join(r, 'docs', 'manifest-format.txt')) | ||
| 42 | for line in fd: | ||
| 43 | help += line | ||
| 44 | fd.close() | ||
| 45 | return help | 50 | return help |
| 46 | 51 | ||
| 47 | def _Options(self, p): | 52 | def _Options(self, p): |
