diff options
Diffstat (limited to 'subcmds/manifest.py')
-rw-r--r-- | subcmds/manifest.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/subcmds/manifest.py b/subcmds/manifest.py index 4415b99e..551b13bd 100644 --- a/subcmds/manifest.py +++ b/subcmds/manifest.py | |||
@@ -17,6 +17,7 @@ import os | |||
17 | import sys | 17 | import sys |
18 | 18 | ||
19 | from command import PagedCommand | 19 | from command import PagedCommand |
20 | from manifest_xml import XmlManifest | ||
20 | 21 | ||
21 | def _doc(name): | 22 | def _doc(name): |
22 | r = os.path.dirname(__file__) | 23 | r = os.path.dirname(__file__) |
@@ -31,7 +32,7 @@ class Manifest(PagedCommand): | |||
31 | common = False | 32 | common = False |
32 | helpSummary = "Manifest inspection utility" | 33 | helpSummary = "Manifest inspection utility" |
33 | helpUsage = """ | 34 | helpUsage = """ |
34 | %prog [-o {-|NAME.xml} [-r]] | 35 | %prog [options] |
35 | """ | 36 | """ |
36 | _xmlHelp = """ | 37 | _xmlHelp = """ |
37 | 38 | ||
@@ -50,13 +51,14 @@ in a Git repository for use during future 'repo init' invocations. | |||
50 | return help | 51 | return help |
51 | 52 | ||
52 | def _Options(self, p): | 53 | def _Options(self, p): |
53 | p.add_option('-r', '--revision-as-HEAD', | 54 | if isinstance(self.manifest, XmlManifest): |
54 | dest='peg_rev', action='store_true', | 55 | p.add_option('-r', '--revision-as-HEAD', |
55 | help='Save revisions as current HEAD') | 56 | dest='peg_rev', action='store_true', |
56 | p.add_option('-o', '--output-file', | 57 | help='Save revisions as current HEAD') |
57 | dest='output_file', | 58 | p.add_option('-o', '--output-file', |
58 | help='File to save the manifest to', | 59 | dest='output_file', |
59 | metavar='-|NAME.xml') | 60 | help='File to save the manifest to', |
61 | metavar='-|NAME.xml') | ||
60 | 62 | ||
61 | def _Output(self, opt): | 63 | def _Output(self, opt): |
62 | if opt.output_file == '-': | 64 | if opt.output_file == '-': |
@@ -73,9 +75,10 @@ in a Git repository for use during future 'repo init' invocations. | |||
73 | if args: | 75 | if args: |
74 | self.Usage() | 76 | self.Usage() |
75 | 77 | ||
76 | if opt.output_file is not None: | 78 | if isinstance(self.manifest, XmlManifest) \ |
77 | self._Output(opt) | 79 | and opt.output_file is not None: |
78 | return | 80 | self._Output(opt) |
81 | return | ||
79 | 82 | ||
80 | print >>sys.stderr, 'error: no operation to perform' | 83 | print >>sys.stderr, 'error: no operation to perform' |
81 | print >>sys.stderr, 'error: see repo help manifest' | 84 | print >>sys.stderr, 'error: see repo help manifest' |