Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

Expose bin_path after parsing#139

Open
yanganto wants to merge 7 commits intouutils:mainfrom
yanganto:expose-bin-name
Open

Expose bin_path after parsing#139
yanganto wants to merge 7 commits intouutils:mainfrom
yanganto:expose-bin-name

Conversation

@yanganto
Copy link
Copy Markdown

fix #137

@yanganto
Copy link
Copy Markdown
Author

Hi @tertsdiepraam
The CI fail of Clippy is nothing about the change in the PR. If you want me to fix it in this PR, I am happy to do so.

@yanganto
Copy link
Copy Markdown
Author

yanganto commented Jun 9, 2025

Hi @tertsdiepraam
How do you think about this PR?

The bin name is exposed as PathBuf now.

Additionally, when a user developing with uutils-args with cargo run -- -h the bin name in the doc will show the bin name, and not the path to the bin.

If you have any further concern, I am happy to work on it. 😄

Copy link
Copy Markdown
Collaborator

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Looks good!

There are some things we should probably think about after this change. Maybe it makes sense to not return a tuple but a struct like this:

struct Parsed<S> {
    bin_name: PathBuf,
    operands: Vec<OsString>,
    settings: S,
}

Happy to accept this PR as it is too, but if you agree we can still make that change here.

@yanganto
Copy link
Copy Markdown
Author

Hi, @tertsdiepraam

The struct Parsed<S> is implemented, and also fn trim(self) -> S for Parsed<S> is provided, such that in the happy case, user can straightforwardly get the settings.

If there is anything better to have, I am happy to add it into the PR. 😃

@yanganto
Copy link
Copy Markdown
Author

Hi, @tertsdiepraam

Does anything need to change in the PR?

@tertsdiepraam
Copy link
Copy Markdown
Collaborator

After getting rid of a lot of notifications, I found this again. I'm not really involved with the project anymore so I'm gonna defer to the other maintainers (@sylvestre?). But it looks good

@yanganto
Copy link
Copy Markdown
Author

Hi @sylvestre
I am looking forward to your reviews and comments,
The key change is return struct Parsed after parse.
https://github.com/yanganto/uutils-args/blob/7a55903a455cf547898b15c3b256c686d83b2c65/src/lib.rs#L225-L229

If there is anything need to change please let me know.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose bin_name after parsing

2 participants