Don't complete other subcommands, consider subcommand in addition to previous word (#30)
Don't complete other subcommands, consider subcommand in addition to previous word (#30)

* rm trailing space for completing dirs for generate

* should perhaps switch from compgen -d to _filedirs as well to
  handle spaces better

* guard call to compopt with check via "type"

* compopt is not available on rain

* fill in missing defaults and -- args

* was missing sample and expfile for summary
* wrongly put sample under submit
* added in the --no- flags

* look at more than prev word when completing

* no longer complete other subcommands as yargs does
* so instead look at which subcommand and use that to
  provide options when we can't tell from prev
* some special treatment of .yml files and HEAD* since
  those can currently only be followed by options/flags
  * It will still autocomplete epochs even if you have
    one if you put something between them
  * Could also put a regex in for the concrete epoch
    names
* takes care not to complete after interval/tag/batch

* no need to go backwords to find previous command

* it searched from the end to find the most recent command typed to
  be consistent with yargs' behavior of allowing multiple commands

ledif/dimebox,ledif/dimebox,eqdmuf/dimebox,dlatypov/dimebox