Skip to content

Add a flag for specifying a regex to match lines #44

@mardukbp

Description

@mardukbp

Motivation

Use heatseeker for:

Quickly navigating log files

Entries in a log file can be matched using

^\d{2}\.\d{2}\.\d{4}

Each entry may span multiple lines.

Filtering the list of flags of a command, obtained from the man page or using cmd --help.

The following yields the list of flags of the cal command:

regex="^ *-.*\n.*"
man cal | col -b | rg -Uo "$regex"

Excerpt:

-1      Display only the current month. This is the default.                                                                                                                                                       
-A      number                                                                                                                                                                                                                  
    Months to add after. The specified number of months is added to the end of the display. This is in addition to any date range selected by the -y, -3, or -1 options. For example, “cal -y -B2         

An entry may span multiple lines. Searching for months in heatseeker should show the whole entry:

-A      number                                                                                                                                                                                                                  
    Months to add after. The specified number of months is added to the end of the display. This is in addition to any date range selected by the -y, -3, or -1 options. For example, “cal -y -B2         

Additional context

This feature request is inspired by rofi, a GUI fuzzy selector for X11 and compile-mode in Emacs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions