Skip to content

Three separate, near-identical implementations of the default history-display-command resolver #144

Description

@codeforester

Summary

The same (cli_name, argv) -> str default (cli_name.replace("_", "-")) is independently implemented in three different layers.

Details

  • lib/python/base_cli/context.py:36-37 (_default_history_display_command)
  • lib/python/base_cli/history.py:256-258 (display_command)
  • lib/python/base_cli/profile.py:141-142 (_generic_history_display_command)

Impact

A future change to the "generic" naming convention (e.g. handling additional separators) would need to be applied in three places and could silently drift if one is missed.

Suggested fix

Have context.py and profile.py import and reuse history.display_command (or extract one shared helper) instead of redefining it.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Projects

Status
Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions