summaryrefslogtreecommitdiffstats
path: root/bitbake/bin
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-08-12 11:35:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-15 09:49:11 +0100
commitdc2c873dc63b8ce46b05c5910efa8f89fa25582d (patch)
tree882c4cd9eaf26d4b64f46f736aca9789bad6cc9d /bitbake/bin
parent1c30381714449891d974e8fbb6a9900ce3d5d97a (diff)
downloadpoky-dc2c873dc63b8ce46b05c5910efa8f89fa25582d.tar.gz
bitbake-layers: improve default command help
Improve default help output and make unrecognised commands print it out rather than just an error. (Bitbake rev: 84f20eb874e7e0ae59bc76883ba9698b0cfcdb6b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-xbitbake/bin/bitbake-layers36
1 files changed, 28 insertions, 8 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index d9f95d1e01..0900d001f8 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -76,16 +76,36 @@ class Commands(cmd.Cmd):
76 if not self.cooker_data: 76 if not self.cooker_data:
77 self.prepare_cooker() 77 self.prepare_cooker()
78 78
79 def default(self, line):
80 """Handle unrecognised commands"""
81 sys.stderr.write("Unrecognised command or option\n")
82 self.do_help('')
83
84 def do_help(self, topic):
85 """display general help or help on a specified command"""
86 if topic:
87 sys.stdout.write('%s: ' % topic)
88 cmd.Cmd.do_help(self,topic)
89 else:
90 sys.stdout.write("usage: bitbake-layers <command> [arguments]\n\n")
91 sys.stdout.write("Available commands:\n")
92 procnames = self.get_names()
93 for procname in procnames:
94 if procname[:3] == 'do_':
95 sys.stdout.write(" %s\n" % procname[3:])
96 doc = getattr(self, procname).__doc__
97 if doc:
98 sys.stdout.write(" %s\n" % doc.splitlines()[0])
99
79 def do_show_layers(self, args): 100 def do_show_layers(self, args):
80 """show_layers: shows current configured layers""" 101 """show current configured layers"""
81 self.check_prepare_cooker() 102 self.check_prepare_cooker()
82 logger.info(str(self.config_data.getVar('BBLAYERS', True))) 103 logger.info(str(self.config_data.getVar('BBLAYERS', True)))
83 104
84 def do_show_overlayed(self, args): 105 def do_show_overlayed(self, args):
85 """show_overlayed: list overlayed recipes (where there is a recipe in another 106 """list overlayed recipes (where there is a recipe in another layer that has a higher layer priority)
86layer that has a higher layer priority)
87 107
88syntax: show_overlayed 108usage: show_overlayed
89 109
90Highest priority recipes are listed with the recipes they overlay as subitems. 110Highest priority recipes are listed with the recipes they overlay as subitems.
91""" 111"""
@@ -100,9 +120,9 @@ Highest priority recipes are listed with the recipes they overlay as subitems.
100 logger.info('No overlayed recipes found') 120 logger.info('No overlayed recipes found')
101 121
102 def do_flatten(self, args): 122 def do_flatten(self, args):
103 """flatten: flattens layer configuration into a separate output directory. 123 """flattens layer configuration into a separate output directory.
104 124
105syntax: flatten <outputdir> 125usage: flatten <outputdir>
106 126
107Takes the current layer configuration and builds a "flattened" directory 127Takes the current layer configuration and builds a "flattened" directory
108containing the contents of all layers, with any overlayed recipes removed 128containing the contents of all layers, with any overlayed recipes removed
@@ -175,9 +195,9 @@ cleanup may still be necessary afterwards, in particular:
175 recipefile.writelines(appendfile.readlines()) 195 recipefile.writelines(appendfile.readlines())
176 196
177 def do_show_appends(self, args): 197 def do_show_appends(self, args):
178 """show_appends: List bbappend files and recipe files they apply to 198 """list bbappend files and recipe files they apply to
179 199
180syntax: show_appends 200usage: show_appends
181 201
182Recipes are listed with the bbappends that apply to them as subitems. 202Recipes are listed with the bbappends that apply to them as subitems.
183""" 203"""