fiatjaf / noscl

Command line client for Nostr.
Other
269 stars 53 forks source link

echo "Hello World" | noscl publish #54

Open d4ndo opened 1 year ago

d4ndo commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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: https://github.com/fiatjaf/noscl/blob/a6aeb03a6d6d1f11c970e77b087edec57e8cdcd9/publish.go#L59

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

xxxserxxx commented 1 year ago

@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.