diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-04-16 13:02:50 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-04-17 07:49:56 +1000 |
commit | 9023bf0ac3eb73ebad8fb333c0b08a0a09332659 (patch) | |
tree | 828dafb3ae566c0bba8acb23931169a68a5d6235 | |
parent | 0d5a208e9240218757e0d4658f9b0d14a4263831 (diff) | |
download | jimtcl-9023bf0ac3eb73ebad8fb333c0b08a0a09332659.zip jimtcl-9023bf0ac3eb73ebad8fb333c0b08a0a09332659.tar.gz jimtcl-9023bf0ac3eb73ebad8fb333c0b08a0a09332659.tar.bz2 |
package: add package names as an alias for package list
Use the same name for this subcommand as Tcl.
For now we keep the existing package list in case it is in use.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | jim-package.c | 15 | ||||
-rw-r--r-- | jim_tcl.txt | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/jim-package.c b/jim-package.c index 8b37c0a..1d42197 100644 --- a/jim-package.c +++ b/jim-package.c @@ -190,7 +190,7 @@ static int package_cmd_require(Jim_Interp *interp, int argc, Jim_Obj *const *arg /* *---------------------------------------------------------------------- * - * package list + * package list|names * * Returns a list of known packages * @@ -199,7 +199,7 @@ static int package_cmd_require(Jim_Interp *interp, int argc, Jim_Obj *const *arg * *---------------------------------------------------------------------- */ -static int package_cmd_list(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +static int package_cmd_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { Jim_HashTableIterator *htiter; Jim_HashEntry *he; @@ -236,7 +236,16 @@ static const jim_subcmd_type package_command_table[] = { { "list", NULL, - package_cmd_list, + package_cmd_names, + 0, + 0, + JIM_MODFLAG_HIDDEN + /* Description: Deprecated - Lists all known packages */ + }, + { + "names", + NULL, + package_cmd_names, 0, 0, /* Description: Lists all known packages */ diff --git a/jim_tcl.txt b/jim_tcl.txt index c4d8996..159dea9 100644 --- a/jim_tcl.txt +++ b/jim_tcl.txt @@ -3455,6 +3455,10 @@ otherwise if '$name.tcl' exists it is loaded with the `source` command. If `load` or `source` fails, `package require` will fail immediately. No further attempt will be made to locate the file. ++*package names*+ + +Returns a list of all known/loaded packages, including internal packages. + pid ~~~ +*pid*+ |