Skip to content

fix: correct fire-and-forget example in apify push --help - #1359

Open
kuntal1461 wants to merge 1 commit into
apify:masterfrom
kuntal1461:fix/push-no-wait-for-finish-example
Open

fix: correct fire-and-forget example in apify push --help#1359
kuntal1461 wants to merge 1 commit into
apify:masterfrom
kuntal1461:fix/push-no-wait-for-finish-example

Conversation

@kuntal1461

Copy link
Copy Markdown
Contributor

Summary

  • The --help example showed apify push --no-wait-for-finish, but that flag was never registered and crashed with Error: Unknown flag provided (fixes apify push --no-wait-for-finish example in --help is broken (Unknown flag provided) #1342)
  • The root cause: the custom CLI framework strips the no- prefix at parseArgs registration time, so a boolean no-wait-for-finish flag would collide with the existing wait-for-finish string flag — they cannot coexist
  • The correct fire-and-forget form is --wait-for-finish=0, which is already documented in the flag's own description; the example now matches

Changes

  • src/commands/actors/push.ts — fix the broken example (2-line change)
  • test/local/lib/command-framework/help.test.ts — regression test: asserts --wait-for-finish=0 appears and --no-wait-for-finish does not

Test plan

  • pnpm vitest run test/local/lib/command-framework/help.test.ts — 13 tests pass, including the new regression test renders a valid fire-and-forget example for apify push
  • pnpm vitest run test/local/commands/push.test.ts — 11 tests pass
  • pnpm run test:local — 491 tests pass, 4 skipped
  • pnpm run format — clean
  • pnpm oxlint --type-aware src/commands/actors/push.ts test/local/lib/command-framework/help.test.ts — 0 warnings, 0 errors
  • git diff --check — clean
  • pnpm run dev:apify push --help — correctly shows $ apify push --wait-for-finish=0

The --help example showed `apify push --no-wait-for-finish`, but that flag
was never registered. The framework strips the no- prefix at parseArgs
registration time, so a boolean no-wait-for-finish flag would conflict with
the existing wait-for-finish string flag and cannot exist alongside it. The
correct fire-and-forget form -- already documented in the flag description
-- is --wait-for-finish=0.

Adds a regression test that asserts the working form appears in the rendered
help and the broken form does not.

Closes apify#1342
@kuntal1461
kuntal1461 force-pushed the fix/push-no-wait-for-finish-example branch from 28fc527 to 6a6adc2 Compare August 27, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

apify push --no-wait-for-finish example in --help is broken (Unknown flag provided)

2 participants