cdown/srt

srt_tools: no input requirement

switchupcb opened this issue · 3 comments

Whenever you run a functionality (i.e srt-process, srt-timeshift, srt-normalise) — that requires an input — without an input, the program just hangs until you ^C.

You can reproduce this in the CLI by doing any of the following with python on the PATH:
python srt-normalise
python srt-deduplicate
python srt-process -f obj
python srt-lines-matching -f obj
python srt-fixed-timeshift --seconds 0
python srt-linear-timeshift ...

srt-mux requires multi-input, so this isn't the case.

cdown commented

I really strongly suggest you read up on how Unix utilities work. This is how basically all Unix utilities that take input work. Just look at grep:

% grep something
^C
% 

There's nothing wrong here.

You did the wrong comparison. This is the equivalent command for grep (no arguments):
grep-noargs

This is the equivalent comparison in srt_tools:
srt-noargs

cdown commented

That's just totally wrong. The equivalent for srt-normalise is cat. The only reason grep itself doesn't work is because you haven't given a pattern.

Your grep example of exiting due to missing an argument is exactly reproducible on cases which require a pattern or input:

% srt lines-matching 
usage: srt lines-matching [-h] [--input FILE] [--output FILE] [--inplace] [--no-strict] [--debug] [--ignore-parsing-errors] [--encoding ENCODING] -f FUNC [-m MODULE] [-s] [-v]
srt lines-matching: error: the following arguments are required: -f/--func

This is the absolute, most basic fundamentals of how Unix utilities work. Really, I have no energy to discuss such a basic thing when the understanding is so off.