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

Make sprintf, vsprintf and strftime available in code for -e and -c #121

Closed
wants to merge 2 commits into from

Conversation

themadsens
Copy link

@themadsens themadsens commented Oct 3, 2017

This enables awk-like usage and much more control than -a+lookups.
Example:

curl -s  -X GET -H "Content-Type: application/json" https://api.cdnjs.com/libraries/ \
  | json results \
  | json -c '
    if (this.latest) 
        console.log(sprintf("%-40s %s", this.name, this.latest.length < 80 ? this.latest : 
                                                      "..."+this.latest.substr(-75))); 
    return false' \
  | grep -v '\[\]'

@trentm
Copy link
Owner

trentm commented Apr 26, 2021

Thank you for the PR! and my apologies for not having responded for years.

I am declining this change because I don't want to increase the scope, especially given that I find little time for maintenance.

@trentm trentm closed this Apr 26, 2021
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.

None yet

2 participants