Skip to content
Snippets Groups Projects

Don't filter redundant info from JSON output

Merged Carl Smedstad requested to merge carlsmedstad/ipcalc:json-print-more-fields into master
1 unresolved thread

Don't filter redundant info from JSON output

In order to make JSON output more uniform, do not filter out info that can be considered redundant for single host IPs.

Does not affect regular (non-JSON) output.

Before:

$ ipcalc --json 127.0.0.1
{
  "ADDRESS":"127.0.0.1",
  "ADDRSPACE":"Loopback"
}

After:

$ ipcalc --json 127.0.0.1
{
  "ADDRESS":"127.0.0.1",
  "NETWORK":"127.0.0.1",
  "NETMASK":"255.255.255.255",
  "PREFIX":"32",
  "BROADCAST":"127.0.0.1",
  "ADDRSPACE":"Loopback",
  "MINADDR":"127.0.0.1",
  "MAXADDR":"127.0.0.1",
  "ADDRESSES":"1"
}

Resolves #21 (closed).

Edited by Carl Smedstad

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 1 {
2 2 "ADDRESS":"127.0.0.1",
3 "HOSTNAME":"localhost",
  • Carl Smedstad added 3 commits

    added 3 commits

    • 789c3899 - Don't filter redundant info from JSON output
    • a874c612 - Reduce scope of some variables
    • bf029d5b - Add basic .editorconfig

    Compare with previous version

  • I reduced the scope of some variables since my linter complained about it. Not a C guru by any means, but from what I understand it's an improvement.

    Also added a .editorconfig to configure my editor to use tabs for indentation.

    If any of these commits are unwanted or out of place I'll drop them.

  • Carl Smedstad added 3 commits

    added 3 commits

    • ad6933f5 - Don't filter redundant info from JSON output
    • c4b15590 - Reduce scope of some variables
    • 96ee403e - Add basic .editorconfig

    Compare with previous version

  • mentioned in commit f6d0a124

  • Please register or sign in to reply
    Loading