struct

Scroll::SortKey

Inherits Struct < Value < Object

A parsed --sort-by key selector. Two concrete grammars:

  • Field — an integer, the Nth whitespace-separated column (1-based).
  • Pattern — a slash-delimited /regex/; the key is the named capture sort if present, else the first capture group, else the whole match.

nil (no --sort-by) means the key is the whole line; that case is handled by the Sorter, not represented here.

Constructors

Instance methods

extract(line : String) : String

Extract the key substring from one line. Returns "" when the selector does not apply to the line (out-of-range column, or a non-matching regex); an empty key sorts first (ascending) / into the non-numeric bucket.

Source
initialize
Source

Nested types