+
Skip to content

Tags: sayanarijit/jf

Tags

v0.6.2

Toggle v0.6.2's commit message

Verified

This tag was signed with the committer’s verified signature.
sayanarijit Arijit Basu
v0.6.2

Minor cleanups and test fixes

v0.6.1

Toggle v0.6.1's commit message

Verified

This tag was signed with the committer’s verified signature.
sayanarijit Arijit Basu
v0.6.1

- Added CLI option -f, --file to read template from file
- `-` will act like an alias for `-f -`

v0.6.0

Toggle v0.6.0's commit message

Verified

This tag was signed with the committer’s verified signature.
sayanarijit Arijit Basu
v0.6.0

- Use `jf -` to read template from stdin
- Refactor the library, separating the CLI and template parsing logic.

NOTE: We can either pass template or pass values from stdin, but not
both.

v0.5.0

Toggle v0.5.0's commit message

Verified

This tag was signed with the committer’s verified signature.
sayanarijit Arijit Basu
v0.5.0

Added CLI options.

This adds:

-r, --raw      output the raw rendered value without formatting
-p, --pretty   pretty print the output
-y, --yaml     output as YAML instead of JSON
-h, --help     print this help message
-v, --version  print the version number
--             stop parsing options

And removes:

- `%v`
- `%R`
- `%Y`
- `%J`

Also the Rust library exposes more functions, each for different
formatting options.

v0.4.2

Toggle v0.4.2's commit message

Verified

This tag was signed with the committer’s verified signature.
sayanarijit Arijit Basu
v0.4.2

Added support for control placeholders.

- `%R` enable raw mode - render but do not format output
- `%Y` enable pretty YAML mode - format output into pretty YAML
- `%J` enable pretty JSON mode - format output into pretty JSON

Example:

```bash
jf "%R%*q" a b c
"a","b","c"

jf "%Y[%*q]" a b c
- a
- b
- c

jf "%J[%*q]" a b c
[
  "a",
  "b",
  "c"
]
```

v0.4.1

Toggle v0.4.1's commit message

Verified

This tag was signed with the committer’s verified signature.
sayanarijit Arijit Basu
v0.4.1

To allow merging arrays and objects via expansion, trailing comma after `s` and
`q` will be auto removed after the expansion if no value is passed for the
placeholder.

Example:

```bash
jf "[%(a)*s, %(b)*s]" b=2 b=1
[2,1]

jf "{%(a)**s, %(b)**s}" b=2 b=1
{"2":1}
```

v0.4.0

Toggle v0.4.0's commit message

Verified

This tag was signed with the committer’s verified signature.
sayanarijit Arijit Basu
v0.4.0

- Use `%-s`, `%-q`, `%*-s`, `%*-q`, `%**-s`, `%**-q` syntax to read from stdin.
- Use `%(NAME@FILE)q` syntax to read default value from file.
- Use `%(NAME@-)q` syntax to read default value from stdin.
- Use `NAME@FILE` syntax to pass value for named placeholder from file.
- Use `NAME@-` syntax to pass value for named placeholder from stdin.
- Stdin values are separated by null (`\0`).

Examples:

```bash
seq 1 3 | xargs printf '%s\0' | jf '[%*-s]'

seq 1 3 | xargs printf '%s\0' | jf '{%q: %-s, %q: %(two)s, three: %(three@-)s}' one two two@-
```

Also, display better error for invalid expandable placeholder syntax.

v0.3.3

Toggle v0.3.3's commit message

Verified

This tag was signed with the committer’s verified signature.
sayanarijit Arijit Basu
v0.3.3

Minor fix in usage test

v0.3.2

Toggle v0.3.2's commit message

Verified

This tag was signed with the committer’s verified signature.
sayanarijit Arijit Basu
v0.3.2

- Use `${NAME?}q`/`$(NAME?)s` syntax to define nullable placeholder.
- As opposed to optional placeholders that defaults to blank, nullable
  placeholders will default to `null`.
- Useful for defining nullable string or array items.

Example:

```
jf "[str or bool, %(str)?q %(bool)?s, nullable, %(nullable?)q]" str=true
```

v0.3.1

Toggle v0.3.1's commit message

Verified

This tag was signed with the committer’s verified signature.
sayanarijit Arijit Basu
Improve man page

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载