aboutsummaryrefslogtreecommitdiff
path: root/jimsh.c
AgeCommit message (Collapse)AuthorFilesLines
2023-08-13jimsh, interp, tests: fixes when line editing is disabledSteve Bennett1-0/+5
- Set jim::lineedit to indicate if line editing is configured - Ensure that aio tty works even if line editing is disabled - Skip some tests if line editing is not configured Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-02-05build: quieten compiler warningsSteve Bennett1-1/+3
Irrelevant warnings from some compilers Signed-off-by: Steve Bennett <steveb@workware.net.au>
2019-11-30jimsh: interactive mode: print nullsSteve Bennett1-1/+4
If the interp result contains embedded nulls, print the full result. Reported-by: dbohdan <dbohdan@dbohdan.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-29jimsh: add support for "jimsh -"Steve Bennett1-7/+11
A convenience for evaluating a script on stdin without interactive mode Signed-off-by: Steve Bennett <steveb@workware.net.au>
2015-11-30jimsh: Allow option "--help" and enable place for parsing other options in ↵Evan Hunter1-1/+27
future
2014-10-28Fix [info nameofexecutable] after [cd]Steve Bennett1-1/+1
If argv0 is a relative path, [info nameofexecutable] returned the wrong result after changing directory. So calculate and stash the result during init. Also move internal $jim_argv0 into namespace jim as $jim::argv0 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-15jimsh: minor code cleanupsSteve Bennett1-6/+9
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-10-21Update source files to reflect FreeBSD licenceSteve Bennett1-13/+27
Some files still indicated the older Apache licence. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-07-13Add tcl_platform(pathSeparator)Steve Bennett1-29/+3
Tcl compatible. Also move jimsh initialisation script into initjimsh.tcl Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-07-07Do just enough to make Jim useable with msys/mingwSteve Bennett1-0/+9
Convert some paths from backslashes to forward slashes Handle splitting/joining paths which look like z:/abc/def Identify the platform as mingw Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-01Add Jim_String() macroSteve Bennett1-4/+4
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>
2011-04-14Support 'jimsh --version'Steve Bennett1-0/+5
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-11-19Allow Jim_InteractivePrompt() to return [exit] to callerSteve Bennett1-5/+5
And update jimsh return code handling Reported-By: Patrick WEBER <patrick.weber@live.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-17Add UTF-8 support to regexpSteve Bennett1-0/+3
Plus various ARE enhancements and bug fixes Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-08Don't hardcode /lib/jimSteve Bennett1-108/+26
Instead, set TCL_LIBRARY based on where jim is installed. This defaults to /usr/local (thus /usr/local/lib/jim), or can be modified with either configure or make. e.g. ./configure --prefix=/usr or make prefix=/usr install Now auto_path is initialised only to TCL_LIBRARY, and doesn't include "." which could be undesirable. At the same time, simplify jimsh initialisation using a script instead of C code. Add the path to the executable to auto_path. Also, no longer use JIM_TCL_COMPAT. Always use the tcl-compatible names, $auto_path and $tcl_interactive. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-20Set $argc in jimshSteve Bennett1-0/+1
Apparently tclsh does this. It is just [llength $argv] Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Remove dependence of jim core on stderrSteve Bennett1-3/+6
Remove Jim_PrintErrorMessage() and create Jim_MakeErrorMessage() instead. Move errorInfo to stdlib since it is now required. Also move lassign from tclcompat to stdlib as a core command. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Allow exit from .jimrcSteve Bennett1-6/+11
Only show error on JIM_ERR from .jimrc Also fixes to rlprompt.tcl so it can be used from .jimrc Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Clean up some debuggingSteve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Reduce excessive stack usageSteve Bennett1-24/+37
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Clean up the indentation messSteve Bennett1-15/+23
Use 'indent'. Not perfect, but at least consistent. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Improve stack trace handlingSteve Bennett1-1/+1
*: Get rid of JIM_ERR_ADDSTACK and use interp->addStackTrace instead *: 'return -code error' doesn't add a stack frame *: Rename _file_copy to {file copy} for better error messages *: Use 'return -code' to prevent excessive levels in the stack trace Also rename info_nameofexecutable to {info nameofexecutable}
2010-10-15Bug fixes and featuresSteve Bennett1-0/+2
Support end+<n> index And generally simplify the index handling Add support for 'info nameofexecutable'
2010-10-15Many improvements, bug fixesSteve Bennett1-23/+1
*: 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-15Bugs, features, testsSteve Bennett1-12/+25
The result of boolean ops on doubles is an int *: e.g. 0.5 < 0.1 should be 0, not 0.1 Implement jimsh -e <cmd> Allow jim to be built in a different location *: e.g. mkdir build; cd build; ../configure ...; make jimsh Add dict.test
2010-10-15Fix a couple of bugsSteve Bennett1-1/+2
Fix unset ::var properly this time Ensure that jimsh exits with the correct exit code *: Previously a script that did 'exit 0' would exit with 7!
2010-10-15Implement some new featuresSteve Bennett1-4/+4
Implement 'lreplace' Implement 'string last' Implement 'pid' Implement 'info procs' Implement 'info script' Implement 'info patchlevel' as an alias for 'info version' Implement syslog extensions for jim Fix return code display in jim-interactive.c Make jim more compatible if JIM_TCL_COMPAT is set *: Use tcl_interactive rather than jim_interactive *: Use auto_path rather than jim_libpath Add "." to the lib search path, not "./" Fix a couple of files with CRLF line endings
2010-10-15Fix exit code from jimshoharboe1-0/+9
A script exiting with 'exit 0' would not give a return code of 0 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15$argv0 should be the name of the scriptoharboe1-1/+2
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Convert package to use jim-subcmdSteve Bennett1-1/+3
Also, no need to install tcl extensions Display any errors from loading static extensions
2010-10-15More static extension stuffSteve Bennett1-16/+1
2010-10-15Add clock commandSteve Bennett1-0/+2
2010-10-15Add file and exec (along with subcmd support)Steve Bennett1-0/+4
2010-10-15Split package and load out of jim.cSteve Bennett1-0/+6
2010-10-15Strip out unneeded junk from JimSteve Bennett1-2/+6
Nvp, getopt, move interactive processing to jim-interactive.c
2010-10-15Cutover to new workware fork of Jim TclSteve Bennett1-35/+14
Note that this commit removes some files and undoes some commits which will be reapplied later. This is the easiest way to switch across. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-02-01Bring corrected license as mentioned in freebsd/...Wojciech A. Koszek1-14/+25
Remove "FreeBSD license" statements, since it's not a correct term I believe. Small cleanup while being here.
2010-02-01Revert "Bring correct license -- I think freebsd/ directory has an agreements"Wojciech A. Koszek1-25/+14
This reverts commit 1e2fdd7d9e877fbe2c88a4c32f098ce1e575dc1d.
2010-02-01Bring correct license -- I think freebsd/ directory has an agreementsWojciech A. Koszek1-14/+25
for relicensing all files within Jim project. "FreeBSD license" isn't correct term, so basically remove it. Try to make the whole place consistent.
2009-08-162009-08-16 Steve Bennett <steveb@workware.net.au>oharboe1-0/+9
* jimsh.c: A script exiting with 'exit 0' would not give a return code of 0
2009-08-16 * jimsh.c: $argv0 should be the name of the scriptoharboe1-1/+2
2008-06-16 * retire CVS keyword expansion. Plays havoc with patches.oharboe1-2/+0
2005-04-13JimGetExePath needs to be a _path_ not the file name.patthoyts1-2/+4
2005-04-11Fixes for this two bugs:antirez1-5/+7
(1) jim.c Jim_FormatString() char array spec[] is defined as having two elements but at the 'default:' case of the switch statement an assignment is made to the third element (2) jimsh.c JimGetExePath() After the call of strrchr() the value of p could be NULL in the case that argv[0] is just plain "jim". The next line should have a test for NULL added to avoid dereferencing the NULL pointer. (This is the cause of a Bus Error on Mac OS X.) Many thanks to Colin McPhail for reporting this two problems.
2005-04-10Rework of the [scan] command finished. It does not any longer usechi1-2/+3
sscanf for scanning purposes, only for parsing within SetScanFmtFromAny. We could get rid of it there too, if necessary. It pass all tests on all platforms I had access to (mainly Linux, Solaris, FreeBSD, MacOS X). But I am confident, that it will pass on the others as well. A small new introduced C99-ism was fixed in jimsh.c as well.
2005-04-08Fix win32 buildpatthoyts1-1/+7
2005-04-07Fixed a typo that prevented compilation with JIM_ANSICantirez1-2/+2
2005-04-06Modified jimsh.c in order to put the directory of the Jim executableantirez1-2/+73
as a component of jim_libpath.
2005-04-05.jimrc support (or jimrc.tcl). Minimal readline extension, just enoughantirez1-2/+27
to allow to the pure-Jim rlprompt extension to provide a readline-aware interactive shell with history.