aboutsummaryrefslogtreecommitdiff
path: root/jim-subcmd.c
AgeCommit message (Collapse)AuthorFilesLines
2023-07-04subcmd: minor improvementsSteve Bennett1-4/+16
Add support for modulo maxarg count. If maxargs is (e.g.) -2, then a multiple of 2 args is expected. Also expose Jim_SubCmdArgError() to make it easy to add additional arg validation but still have subcmd report the usage. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-07-15subcmd: sort subcommand when returning themSteve Bennett1-11/+28
Both for -commands and -help, and when an error is generated, sort the subcommands. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-09-16perf: cache the result of successful subcmd lookupSteve Bennett1-0/+27
Speeds up jim-subcmd commands such as array, clock, file, aio Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-09-16Simplify error reporting in jim-subcmdSteve Bennett1-13/+4
Make use of Jim_SetResultFormatted() Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-21many comment changes, some small code changesSteve Bennett1-0/+7
Sweep through and clean up all (most) of the comments in the code. While there, adjust some variable and function names to be more consistent, and make a few small code changes - again, mostly for consistency. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-01Minor changes for Tcl compatibilitySteve Bennett1-2/+2
Error messages Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-24Create build-jim-ext for building extensionsSteve Bennett1-2/+1
Simplifies the process of building loadable extensions Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-07Remove use of designated initialisersSteve Bennett1-95/+2
For better compatibility c89 compatibility. Also simplify jim-subcmd. Remove -usage and command descriptions. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-01Add Jim_String() macroSteve Bennett1-6/+6
It is very common to get the string value without the length. Jim_String() is a macro which does that. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-12-21All Jim source should include jimautoconf.hSteve Bennett1-0/+1
This ensures that everything picks up the autoconf settings
2010-10-15Fix help/usage from subcmds under some circumstancesSteve Bennett1-24/+17
jim-subcmd would sometimes omit the subcmd parameter in help and usage display Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Clean up the indentation messSteve Bennett1-26/+43
Use 'indent'. Not perfect, but at least consistent. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Many improvements, bug fixesSteve Bennett1-15/+18
*: Allow math functions to be enabled via configure *: Allow support for references to be removed *: Documentation updates *: Jim_ListLength() now returns the result directly *: Optimise list -> dict conversion *: Consistent capitalisation of some structures, functions *: Add support for abbreviations to Jim_GetEnum() *: The commands to 'info' may be abbreviated *: Use abbreviation support in parsing options to 'subst' *: Use Jim_GetEnum() to parse return code names *: Optimise 'array get', 'array set' if no conversion needed *: Import Tcl string.test *: string compare now returns -1,0,1 like Tcl *: Fix 'string last' with index=0 *: Add support for 'string reverse' *: Add -nocase option to 'string equal' *: Fix infinite loop in 'string repeat str -1' *: Support braced patterns in glob *: glob should not return dot files unless the pattern starts with . *: Simplify glob.tcl by using some new features *: When creating C extensions from Tcl, preserve newlines and invoke with Jim_Eval_Named() to produce more meaningful error messages. *: Also remove all comments, not just those starting in the first column *: Add support for 'n+n' and 'n-n' in string/list indexes (Tcl 8.5) *: Add a level to the stack trace for 'return -code error' *: 'return -code' should also affect the return from 'source' (see Tcl docs) *: Fix lsort -command *: Some systems don't have INFINITY
2010-10-15Bug fixes, documentation updatesSteve Bennett1-8/+8
jimsh - retry on EINTR from fgets() Fix 0 -> NULL for 64 bit systems Fix overlapping memcpy Fix jim array dereferencing bug *: Counting of parentheses was incorrect with nested array references *: The result for array dereference wasn't being used properly Add os.uptime command Documentation: autogenerated command index Fix gets when last line has no newline
2010-10-15Rework/improve jim subcmd handlingSteve Bennett1-6/+86
*: -usage and -help do not generate an error *: -help <cmd> where the cmd is invalid now generates a correct response *: Add Jim_CheckCmdUsage() so top level commands can also be checked and print usage *: Fix the FULLARGV flag which was accidently set to the same value as the HIDDEN flag *: If -help is specified for an invalid or amibiguous subcmd, show all commands ------------------------------------------------------------------------
2010-10-15Convert jim-aio.c to use subcmdSteve Bennett1-1/+6
Also: - make stream.server set SO_REUSEADDR - do object reference properly for callbacks - white space cleanup in jim-eventloop.c - fix the pwd command - add support for JIM_MODFLAG_FULLARGV to subcmd - make verbose runtests easier to read - bio might not be available
2010-10-15Make static extensions buildSteve Bennett1-1/+1
Also clean up some white space
2010-10-15Add file and exec (along with subcmd support)Steve Bennett1-0/+194