~kota/gemgen

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH gemgen 0/1] Fix reading from standard input, writing to standard output

Details
Message ID
<164355702799.6410.2046625356972610514-0@git.sr.ht>
DKIM signature
missing
Download raw message
There is code in `main.go` for reading/writing stdin/out.  However, it
was non-functional.  This was because the code was checking to see if
`opts.Names` was `nil`, when in fact it is a zero-length slice (the only
paths that return `nil` for `opts.Names` are those involving errors, the
version flag, or the help flag).

This feature is currently not
documented anywhere in the help output or man page, and it probably
should be.

If you'd like me to add some documentation for it, or to
bump the version, let me know.

Michelle S (1):
  Fix stdin/stdout not working

 main.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.32.0

[PATCH gemgen 1/1] Fix stdin/stdout not working

Details
Message ID
<164355702799.6410.2046625356972610514-1@git.sr.ht>
In-Reply-To
<164355702799.6410.2046625356972610514-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
Patch: +1 -1
From: Michelle S <alterae@protonmail.com>

`options.ParseArgs` returns [] for opts if no files are specified, not
`nil`.  This commit changes the relevant logic to check for that,
allowing reading from standard input and writing to standard output.
---
 main.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main.go b/main.go
index 1706531..5a59207 100644
--- a/main.go
+++ b/main.go
@@ -35,7 +35,7 @@ func main() {
	}

	// Use stdin if no filenames were given.
	if opts.Names == nil {
	if len(opts.Names) == 0 {
		err = Convert(os.Stdin, os.Stdout, opts.GemOptions)
		if err != nil {
			log.Fatalf("failed converting STDIN: %v\n", err)
-- 
2.32.0

[gemgen/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CHJ4E2GG728X.2F9XW380PXRG7@cirno>
In-Reply-To
<164355702799.6410.2046625356972610514-1@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
gemgen/patches/.build.yml: SUCCESS in 2m15s

[Fix reading from standard input, writing to standard output][0] from [~alterae][1]

[0]: https://lists.sr.ht/~kota/gemgen/patches/28867
[1]: alterae@protonmail.com

✓ #684173 SUCCESS gemgen/patches/.build.yml https://builds.sr.ht/~kota/job/684173

Re: [PATCH gemgen 1/1] Fix stdin/stdout not working

Details
Message ID
<CHJA6VQ4PWIT.3K2XOVMMIQ9F3@agar>
In-Reply-To
<164355702799.6410.2046625356972610514-1@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
Thanks for the fix! I saw your email yesterday and was gonna look into
it, but you beat me to it. I updated the docs and pushed out a new
version with your fix. If you run into any other issues or questions
feel free to drop a message here; there's a number of features I'd still
like to add before a version 1.0.
Reply to thread Export thread (mbox)