Closed michaelherger closed 3 months ago
Good idea! If we also make a markdown version, how do we maintain both versions and keep them in sync?
BTW, under the jsonrpc.js section in the docs there is an curl example, so it is really not too bad!
Or is your idea to rewrite every example in the CLI documentation to curl instead of telnet?
I tried to use html2md
with the document. But the outcome isn't great: all the navigation is missing, the code blocks are turned into quotes (due the poor markup in the document) etc. I'd rather leave it as it is, with a link or instructions online.
What I'd really like to see is a page with a few examples, eg. how to skip to the next track using netcat/curl, how to get player state etc. All the details about the CLI can stay where they are. Duplication would kill the effort. We'd rather try to clean up the existing file so it could be converted and updated online automatically.
I started to put some example commands together before noticing you already added a reference page, which seems nice and covers everything I was going to do (curl, wget, nc examples). What do you think it's missing?
The only extra thing I was thinking about mentioning was the difference in behavior of the various nc
implementations, though I'm not sure I fully understand the nuances enough to correctly explain it in writing. For example, busybox nc
always exits when feeding commands to stdin, often before the reply is received and written to stdout, so doing something like this can help if you are trying to capture the response:
{ printf "c0:25:a5:ab:cd:ef status - 10\n"; sleep .1; } | busybox nc 192.168.1.1 9090
And openbsd netcat does sort of the opposite, staying connected after the command when you probably don't want it to. Adding -N
helps here:
printf "c0:25:a5:ab:cd:ef status - 10\n" | nc -N 192.168.1.1 9090
Not sure if that's worth wading into or not?
Also, the IP in this example is missing an octet:
I believe the busybox netcat is a special case, as most of the busybox tools come with a reduced/different feature set. We should not really handle this here, but probably leave a note saying that it can be different, in particular on pCP.
Oh, and thanks for the heads up about the IP address. Should be fixed shortly.
I guess now that Daksol's PR (https://github.com/LMS-Community/lms-community.github.io/pull/24) is merged this can be closed. Thanks @Daksol!
Source was LMS version 8.5
Two chunks of content from the original file were NOT migrated. For clarity the html of those sections included in this comment as zipped html attachments:-
We have a pretty complete CLI documentation built in to LMS. But it doesn't cover the use of those commands using tools like netcat, curl, or wget.
And maybe we could even render a more user friendly version of the above by converting it to markdown?...