Commit graph

7 commits

Author SHA1 Message Date
wiz
63e4974f80 jless: add missing build dependencies 2022-03-14 13:19:19 +00:00
pin
9d5e8e576d textproc/jless: update to 0.8.0
This new release of jless ships with two major new features: basic YAML support
and copying to clipboard!

jless will now check the file extension of the input file, and automatically
parse .yml and .yaml files as YAML and use the same viewer as for JSON data.
Alternatively passing in a --yaml flag will force jless to parse the input as
YAML and can be used when reading in YAML data from stdin.
(alias yless="jless --yaml" perhaps?) YAML aliases are automatically expanded,
but their corresponding anchors are not visible, nor are comments. YAML supports
non-string keys, and even non-scalar keys in mappings (e.g., the key of map can
be an array with multiple elements). Non-string keys are shown with square
brackets, e.g., [true]: "value", instead of quotes. Non-scalar keys are handled
on the screen and displayed properly, but you cannot expand and collapse their
individual elements.

While navigating data, jless also now supports copying various items to your
system clipboard.

    yy will copy the value of the currently focused node, pretty printed
    yv will copy the value of the currently focused node in a "nicely" printed
    one-line format
    yk will copy the key of the current key/value pair
    yp will copy the path from the root JSON element to the currently focused
    node, e.g., .foo[3].bar
    yb functions like yp, but always uses the bracket form for object keys,
    e.g., ["foo"][3]["bar"], which is useful if the environment where you'll
    paste the path doesn't support the .key format, like in Python
    yq will copy a jq style path that will select the currently focused node,
    e.g., .foo[].bar

This release also includes a couple of new movement commands, and some stability
fixes. The full list of changes can be seen below.
Full list of changes
New features:

    Support displaying YAML files with autodetection via file extension, or
    explicit --yaml or --json flags.
    Support copying values (with yy or yv), object keys (with yk), and paths to
    the currently focused node (with yp, yb or yq).
    Implement ctrl-u and ctrl-d commands to jump up and down by half the
    screen's height, or by a specified number of lines.
    Implement ctrl-b and ctrl-f commands for scrolling up and down by the height
    of the screen. (Aliases for PageUp and PageDown)

Improvements:

    Keep focused line in same place on screen when toggling between line and
    data modes; fix a crash when focused on a closing delimiter and switching to
    data mode.
    Pressing Escape will clear the input buffer and stop highlighting search
    matches.

Bug Fixes:

    Ignore clicks on the status bar or below rather than focusing on hidden
    lines, and don't re-render the screen, allowing the path in the status bar
    to be highlighted and copied.
    Issue #61: Display error message for unrecognized CSI escape sequences and
    other IO errors instead of panicking.
    Issue #62: Fix broken window resizing / SIGWINCH detection caused by
    clashing signal handler registered by rustyline.
    PR #54: Fix panic when using Ctrl-C or Ctrl-D to cancel entering search
    input.

Other Notes:

    Upgraded regex crate to 1.5.5 due to CVE-2022-24713. jless accepts and
    compiles untrusted input as regexes, but you'd only DDOS yourself, so it's
    not terribly threatening vulnerability.
2022-03-11 10:22:27 +00:00
pin
d2053669c1 textproc/jless: update to 0.7.2
New features / changes:
-Space now toggles the collapsed state of the currently focused node, rather
 than moving down a line. (Functionality was previous available via i, but
 was undocumented; i has been unmapped.)

Bug fixes:
-Searching now works even when input is provided via STDIN.

Internal:
-Upgraded from structopt to clap v3
2022-02-21 09:43:40 +00:00
pin
13d75d9f80 Remove conflict flag 2022-02-10 10:49:42 +00:00
pin
880516eb7c textproc/jless: rename command
to avoid conflict with misc/ja-less.
2022-02-10 08:31:22 +00:00
wiz
46d5bccc43 *: add conflict between ja-less and jless due to bin/jless 2022-02-10 07:45:23 +00:00
pin
a8de1c4a38 textproc/jless: import package
jless is a command-line JSON viewer.
Use it as a replacement for whatever combination of less, jq, cat and your
editor you currently use for viewing JSON files.
It is written in Rust and can be installed as a single standalone binary.

Features
   -Clean syntax highlighted display of JSON data, omitting quotes around
    object keys, closing object and array delimiters, and trailing commas.
   -Expand and collapse objects and arrays so you can see both the high- and
    low-level structure of the data.
   -A wealth of vim-inspired movement commands for efficiently moving around
    and viewing data.
   -Full regex-based search for finding exactly the data you're looking for.
2022-02-09 17:02:46 +00:00