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

add rotate (-r) option #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ninewise
Copy link

Rotates the two top items on the stack. This allows for some powerful manipulations.

  • Wrap a json as a value (add wrap (-w) option #52): echo '{"a":1, "b":2}' | jshon -e a -n object -r -i a2 -i a becomes {"a": {"a2": 1}, "b":2}
  • Selecting some items by key (Extract and insert into new object #55): echo '{"a":1, "b":2, "c":3}' | jshon -e a -r -e b -r -p -n object -r -i b -r -i a becomes {"b":2, "a":1}

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.

1 participant