Skip to content

Add CLI Support for playFrames Animation #9

@pushkarscripts

Description

@pushkarscripts

Description:

We want to add full CLI support for the flossum playFrames animation, allowing users to pass custom frames and options like --delay and --repeat.

Currently, playFrames isn't properly supported via CLI with arguments like:

flossum playFrames --frames "[= ]" "[==]" "[===]" --delay 100 --repeat 2

Expected behavior: the frames should animate in sequence, with the specified delay between them, and repeat the whole cycle as specified.


Implementation Steps:

  • Modify CLI (bin/flossum.js) to extract --frames, --delay, and --repeat using minimist
  • Pass these as an options object to flossum.playFrames()
  • Add input validation: ensure frames is an array, delay/repeat are numbers
  • Update CLI --help output
  • Update README examples with `playframes' usage

Example Code Snippet:

case 'playFrames':
  await flossum.playFrames({
    frames: args.frames || ["⠋", "⠙", "⠚", "⠞"],
    delay: parseInt(args.delay) || 100,
    repeat: parseInt(args.repeat) || 2
  });
  break;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions