home ¦ Archives ¦ Atom ¦ RSS

TIL: Click Context Parameter Source

TIL that click, my favorite CLI processing toolkit, has a mechanism to determine how a CLI option was provided Context.get_parameter_source

Get the source of a parameter. This indicates the location from which the value of the parameter was obtained.

This can be useful for determining when a user specified a value on the command line that is the same as the default value. It will be DEFAULT only if the value was actually taken from the default.

Via Stack Overflow

© 2008-2025 C. Ross Jam. Licensed under CC BY-NC-SA 4.0 Built using Pelican. Theme based upon Giulio Fidente’s original svbhack, and slightly modified by crossjam.