이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 6. Formatting Hammer output
You can modify the default formatting of the output of Hammer commands to simplify the processing of this output by other command line tools and applications.
Hammer provides several output formats:
-
table– generates output in the form of a human readable table (default). -
base– generates output in the form of key-value pairs. -
yaml– generates output in the YAML format. csv– generates output in the Comma Separated Values format. Output in CSV format is useful for example when you need to parse IDs and use them in a for loop.To define a custom separator, use the
--csvand--csv-separatoroptions instead.-
json– generates output in the JavaScript Object Notation format. -
silent– suppresses the output.
Procedure
Set the output format with the
--outputoption:hammer --output output_format organization list
$ hammer --output output_format organization listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Define a custom separator for the CSV format:
hammer --csv --csv-separator ";" organization list
$ hammer --csv --csv-separator ";" organization listCopy to Clipboard Copied! Toggle word wrap Toggle overflow