Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

echo "Hello World" | noscl publish #54

Open
d4ndo opened this issue Mar 30, 2023 · 4 comments
Open

echo "Hello World" | noscl publish #54

d4ndo opened this issue Mar 30, 2023 · 4 comments

Comments

@d4ndo
Copy link

d4ndo commented Mar 30, 2023

Isn't that how it should work if you adopt the Unix philosophy? Or am I making a mistake?

stdin should be assumed as default if no string is passed.

Stupid example:

Let's say I want to post my uptime.
$ uptime | noscl publish

@xxxserxxx
Copy link

You can do this in the current version by passing - as the content. Not sure I'd have done it that way, but it works:

$ uptime | noscl publish -

@PlebeiusGaragicus
Copy link

You can do this in the current version by passing - as the content. Not sure I'd have done it that way, but it works:

This did NOT work for me:

echo "issue #54" | noscl publish -

It published a dash.

@PlebeiusGaragicus
Copy link

I also just tried noscl publish - and it didn't read from standard input either, just published a dash again. But, I found the code so this should be working:

if content == "-" {

I must be missing something... I installed via go install github.com/fiatjaf/noscl@latest

@xxxserxxx
Copy link

@latest doesn't get you HEAD on this project. You have to check it out and compile it from the clone. If you do, you get:

$ Usage:
  noscl home [--verbose] [--json] [--onlyreplies] [--noreplies] [--kinds=<kinds>...] [--since=<since>] [--until=<until>] [--limit=<limit>]
  noscl inbox [--verbose] [--json] [--onlyreplies] [--noreplies] [--since=<since>] [--until=<until>] [--limit=<limit>]
  noscl setprivate <key>
  noscl sign <event-json>
  noscl verify <event-json>
  noscl public
  noscl publish [--reference=<id>...] [--profile=<id>...] [--file=<file>] [<content>]
  noscl message [--reference=<id>...] <pubkey> <content>
  noscl metadata --name=<name> [--about=<about>] [--picture=<picture>] [--nip05=<nip05>] [--banner=<banner>] [--displayname=<displayname>] [--lud16=<lud16>] [--username=<username>] [--website=<website>]
  noscl profile [--verbose] [--json] <pubkey>
  noscl follow <pubkey> [--name=<name>]
  noscl unfollow <pubkey>
  noscl following
  noscl event view [--verbose] [--json] <id>
  noscl event delete <id>
  noscl share-contacts
  noscl key-gen
  noscl relay
  noscl relay add <url>
  noscl relay remove [--all]
  noscl relay remove <url>
  noscl relay recommend <url>

which still doesn't mention the -, but it should work. For some reason, docopt cuts off the last line in the USAGE message. In fact, the entire help text output is wonky. I'm not a developer on this project; don't ask me why it's behaving this way. I've used docopt myself in the past and not had issues with it, but I didn't have the bandwidth to dig into the behavior in this project. In any case, clone and go install from the directory, and you should get the feature.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants