SMQTK icon indicating copy to clipboard operation
SMQTK copied to clipboard

Entry point scripts should have more consistent flags/functionality

Open danlamanna opened this issue 9 years ago • 4 comments

The most glaring example being some take a list of globs for files to work on, while others take a path to a filename containing the files to work on.

If there's some underlying convention I'm not seeing, feel free to close this out.

danlamanna avatar Nov 14 '16 15:11 danlamanna

Not exactly addressing your specific example, but I tried to do some standardization with CLI options via the smqtk.utils.bin_utils.utility_main_helper.

As for file-list or CLI-specified globs, I think the original intention was that the utility that uses globs was meant for a smaller number of files where as the file-list ones assumed the possibility of larger data-sets. If I were to pick just one for standardization, I would go with the file list.

Purg avatar Nov 14 '16 15:11 Purg

If that's the case, it would be nice if the file list supported bash-style fifos i.e. compute_classifications --file-list <(find ...) to easily switch between the 2. Currently they use os.path.isfile and that doesn't like a path to /proc/PID/fd.

danlamanna avatar Nov 14 '16 15:11 danlamanna

I haven't attempted this before but it sounds like an interesting addition.

Purg avatar Nov 15 '16 18:11 Purg

FWIW, #287 has support for bash-style fifos by just checking if the path exists. If the user passes a directory instead, the script throws an "IOError: Is a directory" when trying to read from it, which I think is pretty clear.

danlamanna avatar Nov 15 '16 18:11 danlamanna