오늘 팀장으로부터 다음과 같은 프로그램 피드백을 받았다.

The client sending and status always outputs json:

please add -q flag to suppress output

please add -s flag to return ONLY the uuid for use in calling the client with the option -i <case_id>

please add -p flag to output the json as ‘pretty printed’ (jansson -> JSON_INDENT(n) for n=2)

기존에 개발한 프로그램에 대해 추가적인 옵션을 요청한 내용이었는데… 하나하나씩 읽다가 마지막 -p 옵션에 대해 의문이 생겼다.

Pretty print? 대체 이게 왜 필요할까?

기능을 추가하는건 어렵지 않았지만, 그 이유가 궁금했다. 내 마음을 알고 있었는지, 바로 아래쪽 댓글에 그 이유가 적혀 있었다.

pretty print makes it easier to use awk and other tools to find the interesting return line and grab out the value without having to implement a full JSON parser

아!!!! 미처 생각지도 못한 이유였다…

Tags: , ,

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.