[Python] Make option value optional

Discussão em 'Python' iniciado por Stack, Abril 19, 2025.

  1. Stack

    Stack Membro Participativo

    I am working on a small command line tool using Python 2 and click. My tool either needs to write a value, read it, or do not change it. It would be nice if I could do the following:

    mytool --r0=0xffff..........Set value r0 to 0xffff
    mytool --r0......................Read value r0
    mytool...............................Don't do anything with r0

    Based on the documentation, it doesn't seem possible, but I could have missed it. So is it possible or do I have to find a different approach?

    Continue reading...

Compartilhe esta Página