Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support operating on bytes #12

Closed
epage opened this issue Apr 22, 2022 · 2 comments · Fixed by #15
Closed

Support operating on bytes #12

epage opened this issue Apr 22, 2022 · 2 comments · Fixed by #15
Assignees

Comments

@epage
Copy link

epage commented Apr 22, 2022

I'm experimenting with handling completions completely in clap_complete, like python's argcomplete. As an input, I'm getting COMP_LINE which is an environment variable containing the line being parsed, ie an OsStr. I'm wanting to be able to handle non-unicode paths which means I can't operate on OsStr::to_str but need to convert to the raw bytes via os_str_bytes. It looks like shlex operates on bytes internally but doesn't offer a constructor or outputs that stay within bytes.

If you are open to this, I'd be willing to implement support for it.

@fenhl
Copy link
Collaborator

fenhl commented Apr 23, 2022

This sounds like a reasonable addition.

@epage
Copy link
Author

epage commented May 3, 2022

FYI I found I could implement completions in a different way which also saves a lot on complexity, so this is no longer a blocker for me. Its unclear if this new strategy will work universally and I won't ever need this or if I might end up needing this eventually.

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

Successfully merging a pull request may close this issue.

2 participants