The elvdocs still use the old format (#elvdoc:fn or #elvdoc:var) for now, but
will be changed to "fn" and "var" forms soon.
Also remove the accidentally committed cmd/mvelvdoc. It has been used to perform
the conversion automatically but is not supposed to be committed.
- Don't require creating a Getopt object in the API.
- Add a new Parse function, and rename the existing method to Complete.
- Add an Unknown field to Option to indicate unknown options.
- Rewrite the tests.
- Numerous stylistic changes.
I was surprised to see so many legacy lambda syntax examples in the
documentation. This replaces all of them with the new syntax -- excluding
the handful of cases meant to explicitly verify the legacy form is still
valid. This also adds a link to the issue in the release notes which
documents the change in syntax.
Related #664
This change addresses issues reported by the `staticcheck` tool and a
couple reported by the `golint` tool. It also adds missing issue links
to a couple of entries in the release notes. This change deliberately
does not address these warnings since it is unclear whether the project
owner would prefer to suppress or address them:
pkg/store/cmd.go:8:2: should not use dot imports (ST1001)
pkg/store/db_store.go:10:2: should not use dot imports (ST1001)
pkg/store/dir.go:8:2: should not use dot imports (ST1001)
Two different strategies are used:
- For commands that don't actually depend on the editor (but happens to live
inside the edit: module), their tests are changed to use the evaltest
framework.
- For commands that do depend on the editor, a new helper
testThatOutputErrorIsBubbled is used to test them.
Also fix a bug where edit:complete-getopt does not correctly bubble the
exception thrown from callbacks, and where matchers do not bubble output errors.
Also replace (*Frame).OutputChan with (*Frame).ValueOutput, which returns a
small interface for writing to the value output that is also aware when the
reader is gone.
I stumbled across a comment that began with "XXX". It was clearly meant as
a "TODO" comment. This changes all such occurrences. However, a few "XXX"
comments are ambiguous and a better prefix might be "WARNING". The "TODO"
prefix at least ensures someone, eventually, looks into the situation
and either rewords the comment or fixes the problem. This change means
everyone can assume searching for "// TODO" will find all such comments
rather than requiring they also know to search for "// XXX".