Skip to content

Add --json to the list commands (alias ls, class ls, watch ls) #72

Description

@gsjonio

What & why

alias ls, class ls, and watch ls print human tables only. A --json variant makes them scriptable, matching scan --json and keeping the CLI consistent.

Where

  • cmd/netwp/cmds.go (the runAlias/runClass/runWatch list branches) and cmd/netwp/json.go.

Scope

  • When hasArg("--json"), emit the list as a JSON array (MAC, name/class, etc.) via printJSON.
  • Small command-local DTOs if the store types don't serialize cleanly (see how scan --json uses a DTO).
  • Document in help text and both READMEs.

Acceptance

  • netwp alias ls --json (and class/watch) emit valid JSON.
  • Full verify suite clean.

Good first issue: repetitive, guided by the existing --json commands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions