qTipTip / Pylette

A Python library for extracting color palettes from supplied images.
https://qtiptip.github.io/Pylette/
MIT License
108 stars 11 forks source link

[feat] Revamp CLI and add CLI tests #44

Closed qTipTip closed 1 month ago

qTipTip commented 1 month ago

This PR revamps the CLI using the typer library. It also adds tests for the CLI using the typer.testing.CliRunner.

   pylette --help

   Usage: pylette [OPTIONS]                                                                                                                                                                                                                 

  ╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
  │ --filename                                     PATH                   [default: None]                                                                                                                                                  │
  │ --image-url                                    TEXT                   [default: None]                                                                                                                                                  │
  │ --mode                                         [KM|MC]                [default: KM]                                                                                                                                                    │
  │ --n                                            INTEGER                [default: 5]                                                                                                                                                     │
  │ --sort-by                                      [frequency|luminance]  [default: luminance]                                                                                                                                             │
  │ --stdout                --no-stdout                                   [default: stdout]                                                                                                                                                │
  │ --out-filename                                 PATH                   [default: None]                                                                                                                                                  │
  │ --display-colors        --no-display-colors                           [default: no-display-colors]                                                                                                                                     │
  │ --colorspace                                   [rgb|hsv|hls]          [default: rgb]                                                                                                                                                   │
  │ --install-completion                                                  Install completion for the current shell.                                                                                                                        │
  │ --show-completion                                                     Show completion for the current shell, to copy it or customize the installation.                                                                                 │
  │ --help                                                                Show this message and exit.                                                                                                                                      │
  ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯