Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Thursday, June 13, 2019
 
 

soljsonfmt(1)

Name

soljsonfmt - format JSON data

Synopsis

/usr/bin/soljsonfmt [-c|-d] [json-file...]

Description

soljsonfmt without the –c or –d options formats JSON data in a consistent manner, including the lexical sorting of associative array indexes.

If no arguments are given, soljsonfmt reads stdin until EOF, and then writes the formatted JSON to stdout. Any JSON files specified on the command line are formatted in place.

soljsonfmt with the –c option checks whether the specified files are formatted in soljsonfmt style. The – d option displays the differences if the file is not properly formatted.

Options

The following options are supported:

–?
–-help

Display a usage message.

–c

Check whether the file is formatted in the soljsonfmt style.

–d

Display file differences from the formatted version in unified form.

Exit Status

The following exit values are returned:

0

Command succeeded.

1

The –c or –d options were specified, and one or more files are not in soljsonfmt normal form, or an error occurred.

2

Invalid command line options were specified.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
developer/base-developer-utilities
Interface Stability
Uncommitted