Skip to content

feat: add --json output format to all commands#77

Open
nguyenquockhang1610 wants to merge 1 commit into
ApexOpsStudio:mainfrom
nguyenquockhang1610:feat/json-output
Open

feat: add --json output format to all commands#77
nguyenquockhang1610 wants to merge 1 commit into
ApexOpsStudio:mainfrom
nguyenquockhang1610:feat/json-output

Conversation

@nguyenquockhang1610
Copy link
Copy Markdown

Summary

Adds --json flag to all CLI commands for scripting and automation (#1).

Usage

# Add task with JSON output
python task.py --json add "Buy groceries"
# {"status": "added", "task": {"id": 1, "description": "Buy groceries", "done": false}}

# List tasks as JSON
python task.py --json list
# {"tasks": [{"id": 1, "description": "Buy groceries", "done": false}]}

# Mark done with JSON output
python task.py --json done 1
# {"status": "done", "task": {"id": 1, "description": "Buy groceries", "done": true}}

Testing

All 6 tests pass including new JSON output tests.

Closes #1

- Add --json flag to main parser
- add command: outputs {"status": "added", "task": {...}}
- list command: outputs {"tasks": [...]}
- done command: outputs {"status": "done", "task": {...}}
- Added tests for JSON output format
- All 6 tests pass

Closes ApexOpsStudio#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.

Add --json output format

1 participant