Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress Spinner Text For Valid JSON output #20

Open
joeygrasso opened this issue May 1, 2024 · 2 comments
Open

Suppress Spinner Text For Valid JSON output #20

joeygrasso opened this issue May 1, 2024 · 2 comments

Comments

@joeygrasso
Copy link

When adding --json for JSON formatted output, the akamai.StartSpinner() outputs text that is not valid JSON.

This greatly diminishes the ability for other scripts and programs to leverage native JSON output without first storing it as a flat file with --output or having some additional parsing.

Example:

» akamai dns list-recordsets FQDN_TLD --json                  
Retrieving Recordsets List ... [OK]
Assembling Recordsets List ... [OK]

{
  "Recordsets": [
    {
      "name": "FQDN_TLD",
      "type": "A",
      "ttl": 600,
      "rdata": [
        "1.1.1.1"
      ]
    }
  ]
}

It would be nice to have a global flag or config option to supress the functions defined in: https://github.com/akamai/cli-common-golang/blob/master/spinner.go

@joeygrasso
Copy link
Author

I am happy to help make this change and work with Contributors on the implementation details.

I am also unsure if this would fit in with the main CLI, the shared common lib, or within this DNS package.

@jschauma
Copy link

+1, please.

Generating json output and then having non-json output interspersed means I can't actually post-process the json data.

Maybe this sort of message should go to stderr, not stdout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants