Repository navigation
Fix CLI argument handling and exit codes - #76
Merged
Merged
Conversation
Flags after the filename were silently ignored because flag.Parse stops at the first positional argument. Parse repeatedly so flags work on either side of the filename, and honor -- as the end of flags. Reject more than one filename instead of ignoring the extras. Explicit -h and -help now print usage to stdout and exit 0. A missing filename still prints usage to stderr and exits 1. Reading from - now fails with a message when standard input is a terminal, instead of blocking. Closes #67
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mdview file.md -o out.html).--ends flag parsing.-hand-helpprint usage to stdout and exit 0. A missing filename still exits 1 with usage on stderr.mdview -fails with a message when stdin is a terminal, instead of blocking.CLAUDE.md.Adds table-driven tests for
parseFlags. I also checked the exit codes and the stdin cases against the built binary.Closes #67