ossclip 0.1.6 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/program.ts CHANGED
@@ -83,7 +83,10 @@ export function buildProgram(): Command {
83
83
  // OPTIONAL so a bare `ossclip produce` at a TTY opens the wizard instead of
84
84
  // printing a usage error at somebody who does not yet know the flags. A
85
85
  // non-interactive run still gets commander's "missing required argument".
86
- .argument("[input]", "input video file")
86
+ .argument(
87
+ "[input]",
88
+ "input video file, or a folder of clips to concatenate (by name; see --sort)",
89
+ )
87
90
  .option("-o, --out <path>", "output video path (default: <input>.ossclip.mp4)")
88
91
  .option("--cleanup <level>", "exact | light | standard | aggressive", "standard")
89
92
  .option("--transcript <path>", "inject a transcript JSON instead of running whisper")
@@ -95,6 +98,12 @@ export function buildProgram(): Command {
95
98
  )
96
99
  .option("--noise-db <db>", "override the measured silence threshold, e.g. -30", parseFloat)
97
100
  .option("--workdir <dir>", "cache/work directory (default: <input dir>/.ossclip)")
101
+ .option(
102
+ "--sort <order>",
103
+ "when <input> is a folder: order its clips before concatenating them — " +
104
+ "name (default, plain codepoint sort, matches `ls`) or mtime (oldest first)",
105
+ "name",
106
+ )
98
107
  .option(
99
108
  "--aspect <ratio>",
100
109
  "output shape: 9:16 (vertical, default) or 16:9 (landscape, 1920x1080)",
@@ -161,6 +170,12 @@ export function buildProgram(): Command {
161
170
  "cut the flubbed take whenever you say this word out loud (e.g. blooper): " +
162
171
  "removal runs back to the start of the sentence it spoiled. Off unless given",
163
172
  )
173
+ .option(
174
+ "--collapse-retakes",
175
+ "deterministically collapse consecutive near-identical sentences, keeping only " +
176
+ "the last complete attempt — the flub the speaker did NOT mark. Off by default",
177
+ false,
178
+ )
164
179
  .option("--no-cover", "skip the cover image written beside the video")
165
180
  .option("--cover <path>", "cover image output path (default: <out>.cover.jpg)")
166
181
  .option("--open-editor", "open the editor when the run finishes")
@@ -212,6 +227,13 @@ export function buildProgram(): Command {
212
227
  // Parsed, not coerced: a typo'd `--source-fit containn` silently falling
213
228
  // back to cover is exactly the crop the flag exists to prevent.
214
229
  const sourceFit = z.enum(["cover", "contain"]).parse(opts.sourceFit);
230
+ // Same reasoning as --source-fit: a typo'd --sort dat must not silently
231
+ // become the default rather than an error naming the mistake.
232
+ const sort = z.enum(["name", "mtime"]).parse(opts.sort);
233
+ // Final-review fix wave, cheap minor c: distinguishes "the user typed
234
+ // --sort" from "commander's own default filled it in" so produce() can
235
+ // say something when --sort is given for a file, where it does nothing.
236
+ const sortExplicit = command.getOptionValueSource("sort") === "cli";
215
237
  const result = await produce(input, {
216
238
  out: opts.out,
217
239
  cleanup,
@@ -219,6 +241,8 @@ export function buildProgram(): Command {
219
241
  render: opts.render,
220
242
  mezzanine: opts.mezzanine,
221
243
  workdir: opts.workdir,
244
+ sort,
245
+ sortExplicit,
222
246
  aspect: opts.aspect === "16:9" ? "16:9" : "9:16",
223
247
  noiseDb: opts.noiseDb,
224
248
  produce: opts.produce,
@@ -235,6 +259,7 @@ export function buildProgram(): Command {
235
259
  // string on the same key.
236
260
  sourceIsEdited: opts.sourceIsEdited === true,
237
261
  blooperMarker: opts.blooperMarker,
262
+ collapseRetakes: opts.collapseRetakes,
238
263
  sourceFit,
239
264
  cover: opts.cover !== false,
240
265
  coverPath: typeof opts.cover === "string" ? opts.cover : undefined,