anoved / Shapetcl

Simple shapefile access for Tcl.
MIT License
3 stars 0 forks source link

Review minimum argument count checks #47

Closed anoved closed 11 years ago

anoved commented 11 years ago

All commands that receive Tcl_Obj arguments check for too many arguments, but most are a little hazy on the minimum checking. This is based on the assumption that they are called in turn from other commands. the first couple arguments are typically the shp token and subcommand name, but checking for this explicitly might allow for other uses. minimum check should be a different conditional, since tcl_wrongnumargs will not necessarily have any of the initial arguments to display.

anoved commented 11 years ago

Most of my subcommands are set up just like Tcl_Proc commands, even though they are not invoked directly, but simply called from the cmd_dispatcher. This is why it has been ambiguous what sort of min arg count check is appropriate.

anoved commented 11 years ago

Upper and lower argument checks are spread across compound commands. The top level command checks that the minimum is met, and the subcommand[s] check that the remaining arg count is valid.