Skip to content

feat: add --ignore-parent option to override --no-ignore-parent#1959

Open
tmchow wants to merge 1 commit intosharkdp:masterfrom
tmchow:osc/1958-ignore-parent
Open

feat: add --ignore-parent option to override --no-ignore-parent#1959
tmchow wants to merge 1 commit intosharkdp:masterfrom
tmchow:osc/1958-ignore-parent

Conversation

@tmchow
Copy link
Copy Markdown

@tmchow tmchow commented Apr 6, 2026

Summary

Adds --ignore-parent to undo --no-ignore-parent, filling a gap in the existing override pattern.

Why this matters

Three flags already have an override counterpart: --ignore undoes --no-ignore, --ignore-vcs undoes --no-ignore-vcs, and --require-git undoes --no-require-git. But --no-ignore-parent had no way to be reversed once set in an alias or config. Users who set --no-ignore-parent globally had no per-invocation escape hatch.

Changes

  • src/cli.rs: Added --ignore-parent with overrides_with = "no_ignore_parent", matching the exact pattern used by --ignore-vcs (hidden flag, ArgAction::SetTrue, unit type). Updated the no_ignore_parent doc comment to reference the new override.
  • CHANGELOG.md: Added entry under ## Features in the Unreleased section.

No changes needed in main.rs since clap's overrides_with resets no_ignore_parent to false when --ignore-parent appears later on the command line.

Testing

  • cargo check passes
  • Verified the new flag follows the identical struct pattern as ignore_vcs (cli.rs:77-79)

Fixes #1958

This contribution was developed with AI assistance (Claude Code).

Add the --ignore-parent flag, mirroring the existing pattern where
--ignore-vcs overrides --no-ignore-vcs. This lets users undo
--no-ignore-parent in aliases or config files.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --ignore-parent option

1 participant