AcademySoftwareFoundation / AcademySoftwareFoundation/OpenImageIO
feat(oiiotool): enhance expressions with string formatting operator
- Dominant language
- C++
- Stars
- 2.4k
- Forks
- 698
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 47
Description
It would be handy for the command line expression syntax (things like `{2 * TOP.width}`) had a fully general way to do string formatting.
This may be kind of involved, but I think it's worth doing.
We'll use this issue to track progress and flesh out a spec for it.
As a motivating example, see #5207, where we posit the utility of something like
--offset "{format('{:+}{:+}',X,Y}"
There's a bit of ugliness coming from the fact that we use `{}` in oiiotool for indicating expressions, but also `{}` inside the format specifications, and I'm not sure if it will end up needing special quoting. But the advantage of going for a fully general formatting utility that can be used in expression evaluation means that it not only solves your problem, but likely also unlocks a whole bunch of interesting additional usages.
Contributor guide
Research direction
Start by reviewing oiiotool's command-line expression syntax and the motivating example in issue #5207. Define how a general string-formatting operator interacts with the existing expression braces and quoting rules; done means the specification is settled and the requested formatting use case works without ambiguity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100