Skip to content

[BUG] --hidden is not overridden by --show-hidden or -A #340

Description

@equationzhao

Describe the bug
The help text says --show-only-hidden, --hidden is overridden by --show-hidden/-a/-A, but combining these flags still keeps the HiddenOnly filter active.

As a result, --hidden --show-hidden or --hidden -A only prints hidden files instead of showing all matching entries.

To Reproduce

  1. Create a directory with one visible file and one hidden file:
    tmp=$(mktemp -d)
    touch "$tmp/visible" "$tmp/.hidden"
  2. Run:
    ./g -A --hidden --show-hidden --no-icon --color never "$tmp"
  3. Only .hidden is shown. visible is missing.

Screenshots
Not applicable.

Info (please complete the following information):

  • OS: macOS (darwin/arm64)
  • Version: v0.31.2

Additional context
--hidden appends filter.HiddenOnly, while -a and -A only delete filter.RemoveHidden. They do not remove HiddenOnly, so the documented override does not happen.

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions