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

Flag for script-friendly output #132

Closed
noctuid opened this issue Apr 11, 2020 · 1 comment
Closed

Flag for script-friendly output #132

noctuid opened this issue Apr 11, 2020 · 1 comment

Comments

@noctuid
Copy link

noctuid commented Apr 11, 2020

I have an mpv script that uses webtorrent-cli and parses its output (which is somewhat complicated to do, especially because of the colorized output). It would be nice if there was a flag to just output json once as soon as the server is up (no colors) and nothing else. For example, something like this:

{
    "selected": 0,
    "files": [
        {
            "href": "localhost://8000/...",
            "name": "Video name.mkv",
            "path": "/path/to/Video name.mkv"
        },
        ...
    ]
}

Edit: In some cases it would actually be useful to keep the normal output as well, so if this could just be output on a single line non-colored once the server is up, that would be good (assuming this is the only case where { starts a line). That or if there was a flag to run a command with this as the argument once the server was up.

@feross
Copy link
Member

feross commented Nov 19, 2020

If you want to send a PR implementing a --json flag, we'd review it 👍 I'm closing this issue since there's no bug to fix here, but feel free to continue discussion! ✨

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