Skip to content

feat: bound default output instead of dumping every string #202

Description

@unclesp1d3r

Problem statement

Running stringy on a real binary with no flags dumps every extracted string to the terminal. On a debug build of stringy itself:

target/debug/stringy target/debug/stringy    # prints 47,820 rows

The whole premise of the tool is "meaningful strings, ranked" -- but the default behavior buries that behind tens of thousands of lines. A user's first-ever run floods their scrollback and undersells the ranking that already exists internally.

Proposed solution

Apply a sensible default output bound when --top/--raw are not specified. Options:

  • Default --top to a reasonable N (e.g. 100-200) for TTY output, and print a footer like ... 47,620 more (use --top N or --raw for all).
  • Consider making the cap TTY-aware: bounded when stdout is a terminal, unbounded when piped (so | grep, | jq still see everything). This mirrors how pagers/git behave.

Touches: pipeline (filtering/limit), main.rs (default value + TTY check), output (footer line).

Alternatives considered

  • Keep unbounded default, rely on users to pipe to head/less: poor first-run UX; the tool should be usable without knowing the flags.
  • Always cap regardless of piping: breaks | jq/| grep pipelines that need the full set.

Area

Pipeline / CLI

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions