Improve documentation of SinkSH
ClosedPublic

Authored by rnicole on Aug 2 2018, 8:49 AM.

Details

Summary
  • Add support for positional arguments, options, flags in the syntax tree
  • Add automatic generation of usage string

TODO:

  • Better document the --reduce option in the list command
  • Get the parent command for sub-commands so we could show help for trace on and not just on
  • Pass the syntax to the implementation of the command so commands can easily show help on wrong usage. Also, SyntaxTree could do automatic input validation in the future, this could also help.
  • Even with the new documentation, some command could still be confusing. Should we add some usage examples?

Diff Detail

Repository
R9 Sink
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rnicole requested review of this revision.Aug 2 2018, 8:49 AM
rnicole created this revision.
rnicole updated this revision to Diff 38935.Aug 2 2018, 9:49 AM

Better explanation of the --reduce option in the list command

rnicole edited the summary of this revision. (Show Details)Aug 2 2018, 9:50 AM

Looks great =)

sinksh/syntax_modules/sink_trace.cpp
39

Why not have the syntax() last and avoid the extra declarations?

rnicole added inline comments.Aug 2 2018, 11:09 AM
sinksh/syntax_modules/sink_trace.cpp
39

It's for when reading the code, I find it much nicer to have a good summary of what it does at the top (and it can help newcomers too)

cmollekopf added inline comments.Aug 2 2018, 11:27 AM
sinksh/syntax_modules/sink_trace.cpp
39

That's not the coding style anywhere else in the code though.
It's IMO also a much more established practice in C code to have the main() (or equivalent) function at the bottom, and everything that get's called from it above. Please adjust the code accordingly (REGISTER_SYNTAX at the very bottom, syntax() right above it).

rnicole updated this revision to Diff 38940.Aug 2 2018, 12:09 PM

Put syntax and REGISTER_SYNTAX at the bottom

cmollekopf accepted this revision.Aug 3 2018, 8:10 AM

Excellent, thanks =)

This revision is now accepted and ready to land.Aug 3 2018, 8:10 AM
This revision was automatically updated to reflect the committed changes.