offset idx to accommodate point at which options occur idx = objc no options gnocl::device idx = 1 no subcommand but with options gnocl::device -option AAA -option AAA... idx = 2 subcommand with options gnocl::device cmdName -option AAA -option AAA... idx = 3 gnocl::device cmdName string -option AAA -option AAA... gnoclParseCommandOptions /** \brief Command Template. **/ int gnoclTemplateCmd ( ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[] ) { static const char *description = "description"; static GnoclCommand commands[] = { { "cmdName", "args", "description", "default" }, { NULL } }; static GnoclOption options[] = { /* command/widget specfic options */ ...