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

Formatting of some arguments' help #2771

Closed
DenizUgur opened this issue Mar 4, 2024 · 5 comments
Closed

Formatting of some arguments' help #2771

DenizUgur opened this issue Mar 4, 2024 · 5 comments

Comments

@DenizUgur
Copy link
Contributor

  • There are some filters' arguments whose enum values are shown as commas (,) instead of bar (|). This comes from constants.h. I've tried to change it but it broke something else and I cannot find what is affected by this.
  • Some enum values are also listed as uint but actually they are string. In the code this uint is used as index to get the proper value. Wouldn't make more sense to convert these to str type?

I've listed the affected filters in the attached JSONs.
uints.json
comma.json

@jeanlf
Copy link
Member

jeanlf commented Mar 26, 2024

Some enum values are also listed as uint but actually they are string. In the code this uint is used as index to get the proper value. Wouldn't make more sense to convert these to str type?

No, enums are uint however they are expressed as strings in the command line (just like every other type number/fraction/etc) . On the other hand, the str type is an opaque uff8 string not parsed/checked when loading options.

There are some filters' arguments whose enum values are shown as commas (,) instead of bar (|).

Yes, because most of them are not strict enums, they allow any names + some reserved names (cf logs)

The pixel format, audio format and audio layout could be converted to enum, but currently their type is not an uint so the usage of , instead of | shouldn't be an issue.

Could you detail more how this is problematic for your use case(s) ?

@DenizUgur
Copy link
Contributor Author

It's not really a deal breaker, I just thought there might be some oversight but apperantly everything was well thought.

For non-strict sums, are they signalled with a flag?

@jeanlf
Copy link
Member

jeanlf commented Apr 9, 2024

For non-strict sums, are they signalled with a flag?

What example do you have in mind ?

@DenizUgur
Copy link
Contributor Author

For example, probe's log argument. It's an enum but it's not bound to enum values. Should I just use enum values as suggestions for str type arguments?

Also, probe's log argument's enum values are separated with both comma and "or"

@jeanlf
Copy link
Member

jeanlf commented Apr 10, 2024

I did a cleanup pass, now all options using enum-like types (including pix fmts & co) will use |as a separator.

For mixed values like inspect.log, the convention is that "_any" should be used to indicate free string.

@jeanlf jeanlf closed this as completed Apr 10, 2024
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

No branches or pull requests

2 participants