Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This change adds a new --cleanup command-line option to the pathman tool. When this flag is used, the tool will non-interactively remove non-existent and duplicate paths from the specified environment variable and update it without launching the interactive editor.

This commit introduces a new `--cleanup` flag to the `pathman` tool.
When this option is provided on the command line, the tool will
automatically perform a cleanup of the specified environment variable.

The cleanup process consists of two steps:
1. Removing any paths that no longer exist on the filesystem.
2. Removing any duplicate path entries.

After cleaning, the tool updates the environment variable with the new,
cleaned-up value and exits. This entire process is non-interactive
and does not launch the TUI, making it suitable for use in scripts.

To implement this, the `remove_dups` and `remove_nonexistent`
functions in the `editor` module have been made public so they can be
called from `main.rs`.
@eminence eminence marked this pull request as ready for review August 20, 2025 03:45
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.

1 participant