Skip to content

refactor(cli): simplify cli package#68

Merged
thomaschristory merged 2 commits into
mainfrom
refactor/cli-simplify
May 12, 2026
Merged

refactor(cli): simplify cli package#68
thomaschristory merged 2 commits into
mainfrom
refactor/cli-simplify

Conversation

@thomaschristory
Copy link
Copy Markdown
Owner

Closes #51

Simplify pass on nsc/cli/. No behaviour changes. All tests pass.

Changes

  • app.py: Remove dead NetBoxAPIError/NetBoxClientError catch in main() — handlers already re-raise as typer.Exit, so this branch never fires. Drop now-unused import.
  • runtime.py: Extract _resolve_ssl_and_timeout() to deduplicate the identical verify_ssl/timeout block duplicated between resolve_transport_settings and resolve_profile. Merge NoProfileError/UnknownProfileError branches in map_error(). Collapse redundant if value is None or not value to if not value in _url_only(). Remove stale "Task 12" reference from module docstring.
  • handlers.py: Extract _out() helper for the repeated stream if stream is not None else sys.stdout ternary (3 call sites). Drop dead raise after refuse_unsupported_bulk() (always raises).
  • globals.py: Trim __all__ to the two symbols actually defined here; remove now-unused re-exported imports.
  • commands_dump.py: Remove stale Phase 1 references from module docstring and option help strings.

🤖 Generated with Claude Code

- Remove dead NetBoxAPIError/NetBoxClientError catch in main() (already re-raised as typer.Exit by handlers)
- Extract _resolve_ssl_and_timeout() to deduplicate verify_ssl/timeout logic shared by resolve_transport_settings and resolve_profile
- Merge duplicate NoProfileError/UnknownProfileError branches in map_error()
- Extract _out() helper in handlers.py to replace repeated stream-or-stdout ternary
- Drop dead `raise` after refuse_unsupported_bulk (always raises)
- Collapse `if value is None or not value` to `if not value` in _url_only()
- Remove stale Phase 1 references from commands_dump.py docstring and help strings
- Trim globals.__all__ to only the two symbols actually defined and imported from this module

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thomaschristory thomaschristory merged commit e1c4b98 into main May 12, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: review & simplify CLI entry-points (app, runtime, login)

1 participant