mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-15 08:12:53 -07:00
chore(release): prepare v0.12.0
This commit is contained in:
@@ -107,11 +107,7 @@ test('parseArgs captures session action forwarding flags', () => {
|
||||
});
|
||||
|
||||
test('parseArgs ignores non-positive numeric session action counts', () => {
|
||||
const args = parseArgs([
|
||||
'--copy-subtitle-count=0',
|
||||
'--mine-sentence-count',
|
||||
'-1',
|
||||
]);
|
||||
const args = parseArgs(['--copy-subtitle-count=0', '--mine-sentence-count', '-1']);
|
||||
|
||||
assert.equal(args.copySubtitleCount, undefined);
|
||||
assert.equal(args.mineSentenceCount, undefined);
|
||||
@@ -221,10 +217,7 @@ test('hasExplicitCommand and shouldStartApp preserve command intent', () => {
|
||||
assert.equal(hasExplicitCommand(toggleStatsOverlay), true);
|
||||
assert.equal(shouldStartApp(toggleStatsOverlay), true);
|
||||
|
||||
const cycleRuntimeOption = parseArgs([
|
||||
'--cycle-runtime-option',
|
||||
'anki.autoUpdateNewCards:next',
|
||||
]);
|
||||
const cycleRuntimeOption = parseArgs(['--cycle-runtime-option', 'anki.autoUpdateNewCards:next']);
|
||||
assert.equal(cycleRuntimeOption.cycleRuntimeOptionId, 'anki.autoUpdateNewCards');
|
||||
assert.equal(cycleRuntimeOption.cycleRuntimeOptionDirection, 1);
|
||||
assert.equal(hasExplicitCommand(cycleRuntimeOption), true);
|
||||
|
||||
+4
-1
@@ -173,7 +173,10 @@ export function parseArgs(argv: string[]): CliArgs {
|
||||
const separatorIndex = value.lastIndexOf(':');
|
||||
if (separatorIndex <= 0 || separatorIndex === value.length - 1) return null;
|
||||
const id = value.slice(0, separatorIndex).trim();
|
||||
const rawDirection = value.slice(separatorIndex + 1).trim().toLowerCase();
|
||||
const rawDirection = value
|
||||
.slice(separatorIndex + 1)
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
if (!id) return null;
|
||||
if (rawDirection === 'next' || rawDirection === '1') {
|
||||
return { id, direction: 1 };
|
||||
|
||||
Reference in New Issue
Block a user