mirror of
https://github.com/larksuite/cli.git
synced 2026-08-03 08:32:46 +08:00
--slide-id used the cobra StringArray flag type, which only accepts repeated flags and does not split comma-separated values, unlike --slide-number (int_array -> cobra IntSlice) which already supported CSV input. This made the two selector flags inconsistent. Switch --slide-id to the string_slice flag type (cobra StringSlice), which natively supports both comma-separated and repeated values, and update the flag readers from StrArray to StrSlice. normalizeSlideIDs already trims/dedupes/filters blanks, and validateSlidesScreenshotSelectorLimit already caps the combined selector count, so both continue to apply unchanged to CSV input. Add tests covering --slide-id CSV parsing, whitespace/duplicate normalization, and the >10 selector limit via CSV, mirroring the existing --slide-number coverage. Address review feedback: - Fix "comma-separate" -> "comma-separated" wording in the --slide-id flag description (CodeRabbit). - Set LARKSUITE_CLI_CONFIG_DIR to t.TempDir() in the new screenshot tests, per the AGENTS.md testing convention, so local configuration state cannot leak into or be modified by the suite. - Add a dry-run E2E test (tests/cli_e2e/slides) that pins --slide-id CSV parsing through the built CLI binary and asserts the emitted slide_ids request body, per the AGENTS.md dry-run E2E requirement for shortcut flag/param changes. - Update the lark-slides skill reference to document that --slide-id and --slide-number both accept comma-separated values, not just repeated flags, so agents can discover the new syntax.