clikt icon indicating copy to clipboard operation
clikt copied to clipboard

add value source location property

Open RafeArnold opened this issue 4 months ago • 1 comments

allowing more useful help messages upon transform failure.

implementation of https://github.com/ajalt/clikt/issues/619

  • add location property to ValueSource.Invocation
  • add location to MapValueSource invocations.
  • add location to JsonValueSource invocations.

RafeArnold avatar Oct 18 '25 09:10 RafeArnold

i think the ability to construct the location string lazily would be useful, as it's only used for the unhappy path of parsing and could potentially require more complex computation for some value sources. i havent implemented this functionality here because it would require OptionInvocation and OptionCallTransformContext to also allow lazy name properties which may have backwards compatibility concerns. i can have a crack at that additional work if it would be useful.

RafeArnold avatar Oct 18 '25 09:10 RafeArnold