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

Issue when using - as stdin and stdout #213

Open
carstencodes opened this issue Oct 26, 2024 · 2 comments
Open

Issue when using - as stdin and stdout #213

carstencodes opened this issue Oct 26, 2024 · 2 comments
Labels
bug Something isn't working Customer Reported Bugs reported by customers

Comments

@carstencodes
Copy link

Hi,

thanks for your nice work.

I have an issue when I declare my arguments as follows:

-f --format (output format)
-o --output (output file, - is supported for using stdout)
input-file (input file, - is supported for stdin)

But when I run my app as follows,

app -f json -o - input.file

then - is used as input-file and input.file is bound to -o.

This is rather unexpected.

@Matthiee Matthiee added bug Something isn't working Customer Reported Bugs reported by customers labels Oct 26, 2024
@Matthiee
Copy link
Member

Hi @carstencodes, thank you for reporting this bug.

Is it possible to use something like ~ or any other character to indicate stin/stdout?

The problem probably is that - is parsed as an option instead of value.

I don't have a lot of time to look at this right now, but I'm happy to review PRs that fix this.

@carstencodes
Copy link
Author

Hi,

I try to be as unix compatible as possible in my application. And the convention here is to use the minus for these streams.

I have read the code a bit and I think the issue is really weird, but bound to a faulty (or rather non-existent) state machine in the ArgumentManager class.

This might take a bit, maybe I'll figure it out ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Customer Reported Bugs reported by customers
Projects
None yet
Development

No branches or pull requests

2 participants