此内容没有您所选择的语言版本。
10.4. Displaying Pretty-Print Output
The JBoss ON CLI has a special class that formats JBoss ON information into table-style output. This class (
TabularWriter
) is implicit for all CLI commands, so almost all output is properly formatted automatically. This class is also available as an implicit variable called pretty, which is useful when writing scripts.
For example:
pretty
formats any object defined in the domain (org.rhq.core.domain) package.
Simply printing the output is much less readable:
rhqadmin@localhost:7080$ println(resources) PageList[Resource[id=11373, type=service-alpha, key=service-alpha-8, name=service-alpha-8, version=1.0], Resource[id=11374, type=service-alpha, key=service-alpha-1, name=service-alpha-1, version=1.0], .... 8< ....
rhqadmin@localhost:7080$ println(resources)
PageList[Resource[id=11373, type=service-alpha, key=service-alpha-8, name=service-alpha-8, version=1.0],
Resource[id=11374, type=service-alpha, key=service-alpha-1, name=service-alpha-1, version=1.0],
.... 8< ....
For a single object,
pretty
checks for the summary information (@Summary), so that it only displays a subset of information. It then prints the summary information for the single object as a formatted list. For example: