luispedro / jug

Parallel programming with Python
https://jug.readthedocs.io
MIT License
412 stars 62 forks source link

Invalidate --target is too greedy #63

Open unode opened 7 years ago

unode commented 7 years ago
-------------------------------------------------------------------------------------
           0           0          1           0           0  jugfile.function
           0           0          1           0           0  jugfile.function_other
.....................................................................................
           0           0          2           2           0  Total

Running jug invalidate --target jugfile.function invalidates everything.

luispedro commented 7 years ago

This is somewhat of a feature (IIRC, it was a patch submitted by a user, but I cannot find the right PR or email right now to remember the discussion) to allow you type only the first few characters.

I agree that it may be confusing, however.

unode commented 7 years ago

So if I actually just want to target jugfile.function, is there some syntax that provides this?

luispedro commented 7 years ago

IIRC -target jugfile.function$ works

unode commented 6 years ago

Every now and then I still trip on this. With invalidate it's quite an expensive and annoying mistake.

Would you be open to changing the API to do exact matching unless * is appended?

jug invalidate --target jugfile.function   ->  only jugfile.function
jug invalidate --target jugfile.function*  ->  both jugfile.function and jugfile.function_other

After Python's philosophy, explicit rather than implicit...