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

JSON Output support? #2

Closed
older-fox opened this issue Feb 22, 2022 · 6 comments
Closed

JSON Output support? #2

older-fox opened this issue Feb 22, 2022 · 6 comments

Comments

@older-fox
Copy link

Can standard IO be implemented?
For example, JSON or XML maybe?

Huge thanks for your job

@a1ive
Copy link
Owner

a1ive commented Feb 22, 2022

可以具体地说一下应用场景吗?

@older-fox
Copy link
Author

您好,非常抱歉这个迟到了近三个月的回复,
该需求被提出时,正值我正在开发一个程序,需要调用nwinfo获取的相关信息以进行自动化操作
然而nwinfo目前仅提供了标准化的文本输出,并未提供一些易于二次开发的文本输出格式,例如XML或者JSON,方便其他程序调用时的文本解析
所以我想能否提供一些赞助来支援您更好地开发出此功能,例如额外增加一个 --format JSON or XML 这样的相对支持,以将程序所获得的结果以JSON或XML格式输出到控制台

@a1ive
Copy link
Owner

a1ive commented Apr 28, 2022

查了一下,这个项目就可以把硬件报告以 JSON/XML/YAML 等方式导出。我好像没必要重新造轮子了。
https://github.com/cavaliercoder/sysinv

@older-fox
Copy link
Author

该项目并未发布可执行二进制文件,且不确定能否稳定兼容现有开发进度,所以可能仍需您的帮助,作为报酬可以付费

a1ive added a commit that referenced this issue Apr 30, 2022
@a1ive
Copy link
Owner

a1ive commented Apr 30, 2022

可以测试一下了:https://github.com/a1ive/nwinfo/releases/tag/latest
目前支持 JSONYAML 格式。
使用 --format=json--format=yaml 来指定输出格式 (默认为 YAML)。
使用 --output= 指定输出文件 (默认为 stdout)。
示例:

nwinfo.exe --format=json --output=report.json --sys --disk --smbios --net --pci

@older-fox
Copy link
Author

感谢您的辛苦付出,这个issue将会被关闭,辛苦

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

No branches or pull requests

2 participants