Skip to content

CLI help: --max_length should be --max-length #1

Open

Description

@lomeliDev

Problem

The CLI help text for two options refers to the flag as --max_length
(underscore), but argparse registers the flag as --max-length (hyphen).
A user who copies the name from the help gets error: unrecognized arguments.

Current output of slugify --help includes:

  --word-boundary       Truncate to complete word even if length ends up
                        shorter than --max_length
  --save-order          When set and --max_length > 0 return whole words in
                        the initial order

Both should read --max-length.

Done criterion (test that fails first)

Add a test (e.g. in tests/test_cli_interrupt.py) that captures the parser
help and asserts the correct flag name:

import importlib, pytest
cli = importlib.import_module('slugify.__main__')

def test_help_uses_hyphenated_max_length(capsys):
    with pytest.raises(SystemExit):
        cli.main(['slugify', '--help'])
    out = capsys.readouterr().out
    assert '--max_length' not in out
    assert '--max-length' in out

This test fails on the current help strings and passes once both help strings
in slugify/__main__.py use --max-length.

Archivos: slugify/main.py, tests/test_cli_interrupt.py

Activity

  1. added
    real3Prueba de punta a punta del taller LISSA (real3)
    on Oct 14, 2026
  2. added
    lissaLISSA: issue que debe recoger la entrada
    on Oct 17, 2026
  3. lomeliDev commented on Oct 17, 2026

    @lomeliDev
    OwnerAuthor

    LISSA (triaje): Resultado: ya cumplida — 1/1 ítems ya en master por #6 (--max_length should be --max-length).

    Evidencia:

    ítem ¿ya está? dónde
    --max_length should be --max-length sí #6

    Si quieres que se trabaje igual, pon la etiqueta lissa:retry (se encola sin triaje).

  4. added
    lissa:retryLISSA: reintentar sin triaje
    and removed
    lissa:retryLISSA: reintentar sin triaje
    on Oct 17, 2026
  5. lomeliDev commented on Oct 17, 2026

    @lomeliDev
    OwnerAuthor

    LISSA: encolada como task_slug_1, a petición de lomeliDev con lissa:retry (sin triaje). Foto sha256 f9f1f125…, 1 comentarios de autores de confianza.

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

    lissaLISSA: issue que debe recoger la entradalissa:ya-cumplidaLISSA: ya estaba cumplidareal3Prueba de punta a punta del taller LISSA (real3)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions