jsonpkger

command
v0.0.0-...-d53c0b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Jsonpkger packages code fragments into JSON form.

It reads a list of file names to be processed from the standard input, one file per line. Each file name must have the format:

path/to/{service}/{version}/{revision}/{id}.frag.{language_suffix} .

The path may be absolute or relative. The "path/to" section may be empty and need not be consistent across files. Only the last four elements of the path are important.

Code fragments are formatted with language-specific code formatters, if available.

Processed files are written under a directory specified by the -dir command-line option.

The design of reading file names from stdin is admittedly unusual in the Unix environment; jsonpkger uses it as a concession to practicality. Each output JSON file contains code fragments in all languages, collated from the various input fragment files provided during a single run. Consequently, it is important that each invocation of jsonpkger be provided with all fragment files for a given method. In most environments, the shell imposes a limit on the length of each command. This makes accepting input file names from the command line impractical as the number of APIs and languages that jsonpkger needs to process grows. Reading file names from stdin alleviates this concern.

To invoke jsonpkger with specified file names on the command line:

ls -1 my_dir | jsonpkger

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL