Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 332969
Collapse All | Expand All

(-)a/bin/portageq (-9 / +12 lines)
Lines 20-25 try: Link Here
20
except KeyboardInterrupt:
20
except KeyboardInterrupt:
21
	sys.exit(1)
21
	sys.exit(1)
22
22
23
import formatter
23
import os
24
import os
24
25
25
import types
26
import types
Lines 148-156 def mass_best_version(argv): Link Here
148
mass_best_version.uses_root = True
149
mass_best_version.uses_root = True
149
150
150
def metadata(argv):
151
def metadata(argv):
151
	"""<root> <pkgtype> <category/package> [<key>]+
152
	Returns metadata values for the specified package.
153
	"""
154
	if (len(argv) < 4):
152
	if (len(argv) < 4):
155
		print("ERROR: insufficient parameters!", file=sys.stderr)
153
		print("ERROR: insufficient parameters!", file=sys.stderr)
156
		sys.exit(2)
154
		sys.exit(2)
Lines 175-180 def metadata(argv): Link Here
175
		print("Package not found: '%s'" % pkgspec, file=sys.stderr)
173
		print("Package not found: '%s'" % pkgspec, file=sys.stderr)
176
		sys.exit(1)
174
		sys.exit(1)
177
175
176
metadata.__doc__ = """
177
<root> <pkgtype> <category/package> [<key>]+
178
Returns metadata values for the specified package.
179
Available keys: %s
180
"""  % ','.join(portage.auxdbkeys)
181
178
metadata.uses_root = True
182
metadata.uses_root = True
179
183
180
def contents(argv):
184
def contents(argv):
Lines 587-611 def usage(argv): Link Here
587
	# Show our commands -- we do this by scanning the functions in this
591
	# Show our commands -- we do this by scanning the functions in this
588
	# file, and formatting each functions documentation.
592
	# file, and formatting each functions documentation.
589
	#
593
	#
590
594
	help_mode = '--help' in sys.argv
591
	for name in commands:
595
	for name in commands:
592
		# Drop non-functions
596
		# Drop non-functions
593
		obj = globals()[name]
597
		obj = globals()[name]
594
598
595
		doc = obj.__doc__
599
		doc = obj.__doc__
596
		if (doc == None):
600
		if (doc == None):
597
			print("   "+name)
601
			print("   " + name)
598
			print("      MISSING DOCUMENTATION!")
602
			print("      MISSING DOCUMENTATION!")
599
			print("")
603
			print("")
600
			continue
604
			continue
601
605
602
		lines = doc.split("\n")
606
		lines = doc.split("\n")
603
		print("   "+name+" "+lines[0].strip())
607
		print("   " + name + " " + lines[0].strip())
604
		if (len(sys.argv) > 1):
608
		if (len(sys.argv) > 1):
605
			if ("--help" not in sys.argv):
609
			if (not help_mode):
606
				lines = lines[:-1]
610
				lines = lines[:-1]
607
			for line in lines[1:]:
611
			for line in lines[1:]:
608
				print("      "+line.strip())
612
				print("      " + line.strip())
609
	if (len(sys.argv) == 1):
613
	if (len(sys.argv) == 1):
610
		print("\nRun portageq with --help for info")
614
		print("\nRun portageq with --help for info")
611
615
612
- 

Return to bug 332969