-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[issue #27] Fix issue handling multi-level lookups (e.g. 'json foo.bar')
- Loading branch information
Showing
4 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
JSON=../../lib/jsontool.js | ||
|
||
echo '{"name":"trent", "age":38}' | $JSON name | ||
echo '{"name":"trent", "age":38}' | $JSON name age | ||
|
||
echo '' | ||
echo '{"name":"trent", "age":38}' | $JSON name missing | ||
|
||
echo '' | ||
echo '[{"name":"trent", "age":38}, {"name":"ewan", "age":4}]' | $JSON -a name | ||
echo '[{"name":"trent", "age":38}, {"name":"ewan", "age":4}]' | $JSON -a name age | ||
|
||
echo '' | ||
echo '{"error":{"code":42,"message":"answer"}}' | $JSON error.code | ||
echo '{"error":{"code":42,"message":"answer"}}' | $JSON error.code error.message | ||
|
||
echo '' | ||
echo '[{"error":{"code":42,"message":"answer"}}]' | $JSON -a error.code | ||
echo '[{"error":{"code":42,"message":"answer"}}]' | $JSON -a error.code error.message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
trent | ||
trent | ||
38 | ||
|
||
trent | ||
|
||
trent | ||
ewan | ||
trent 38 | ||
ewan 4 | ||
|
||
42 | ||
42 | ||
answer | ||
|
||
42 | ||
42 answer |