Skip to content

Commit

Permalink
add alphabetical order CLI arg to README
Browse files Browse the repository at this point in the history
  • Loading branch information
alehechka committed Jul 4, 2022
1 parent 2725d3c commit a843fa5
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ json2go generate --url="https://gorest.co.in/public/v2/users"

### CLI Arguments

| Argument | Example | Type | Purpose | Default |
| ---------------- | ---------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| File name | `--file=example.json` | `string` | Valid path to local file on disk |
| URL | `--url="https://example.com` | `string` | Valid URL that JSON can be fetched via GET request from. |
| Root Object Name | `--root=RootObject` | `string` | Name for top-level object in JSON payload | `Root` |
| Package Name | `--package=api` | `string` | Name of package to generate types into. A nested package path is valid | `main` |
| Output File Name | `--output` | `string` | The name of the file that is generated. If a file is provided as input, will use matching name unless explicitly provided. The ".go" extension is not required and will be automatically appended. | `types.go` |
| Time Format | `--time=2006-01-02` | `string` | Time format to use while parsing strings for potential time.Time variables. View time.Time constants for possible defaults: https://pkg.go.dev/time#pkg-constants | `RFC3339` |
| Omit Empty | `--omitempty` | `bool` | Appends the omitempty to all object variable tags. | `false` |
| Debug logging | `--debug` | `bool` | Will output debugging console logs. | `false` |
| Quiet | `--quiet` | `bool` | Will quiet fatal errors. | `false` |
| STDOUT | `--out` | `bool` | Instead of generating a Go file, will instead print the contents to STDOUT | `false` |
| Argument | Example | Type | Purpose | Default |
| ------------------ | ---------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| File name | `--file=example.json` | `string` | Valid path to local file on disk |
| URL | `--url="https://example.com` | `string` | Valid URL that JSON can be fetched via GET request from. |
| Root Object Name | `--root=RootObject` | `string` | Name for top-level object in JSON payload | `Root` |
| Package Name | `--package=api` | `string` | Name of package to generate types into. A nested package path is valid | `main` |
| Output File Name | `--output` | `string` | The name of the file that is generated. If a file is provided as input, will use matching name unless explicitly provided. The ".go" extension is not required and will be automatically appended. | `types.go` |
| Time Format | `--time=2006-01-02` | `string` | Time format to use while parsing strings for potential time.Time variables. View time.Time constants for possible defaults: https://pkg.go.dev/time#pkg-constants | `RFC3339` |
| Omit Empty | `--omitempty` | `bool` | Appends the omitempty to all object variable tags. | `false` |
| Alphabetical Order | `--alpha` | `bool` | Sorts all keys into alphabetical order before generation. | `false` |
| Debug logging | `--debug` | `bool` | Will output debugging console logs. | `false` |
| Quiet | `--quiet` | `bool` | Will quiet fatal errors. | `false` |
| STDOUT | `--out` | `bool` | Instead of generating a Go file, will instead print the contents to STDOUT | `false` |

### Local Development

Expand Down

0 comments on commit a843fa5

Please sign in to comment.