Skip to content

Add min=1 constraint to --limit on token listing commands #4

Description

@smypmsa

Problem

pumpfun tokens trending --limit -1 uses Python negative slicing, returning ~294 items instead of erroring. --limit 0 returns an empty list silently.

Fix

Add min=1 to all five typer.Option definitions for --limit in src/pumpfun_cli/commands/tokens.py:

limit: int = typer.Option(20, "--limit", "-n", min=1, help="...")

There are 5 commands that need this: trending, new, graduating, top, search.

Files to change

  • src/pumpfun_cli/commands/tokens.py — add min=1 to all 5 --limit options
  • tests/test_commands/ — add test that --limit 0 or --limit -1 errors

How to test

uv run pytest tests/test_commands/ -v

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions