From a98ccf1ca036dffa6380c8d353762dd00c50931d Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Mon, 26 Sep 2022 19:33:04 +0200 Subject: [PATCH] Add 'stashclear' sub-command Introduce stashclear sub-command to delete all stash collection file. This sub-command cannot be called from a modulefile evaluation context. Add sub-command empty skeleton: cmdModuleStashclear. Sub-command accepts no argument nor option. --- .aspell.en.pws | 3 ++- tcl/main.tcl.in | 10 +++++++--- tcl/report.tcl.in | 3 ++- tcl/subcmd.tcl.in | 3 +++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.aspell.en.pws b/.aspell.en.pws index 7c7c3649..d96ef027 100644 --- a/.aspell.en.pws +++ b/.aspell.en.pws @@ -1,4 +1,4 @@ -personal_ws-1.1 en 849 +personal_ws-1.1 en 850 ABBRVLIST ActiveTcl Adrien @@ -288,6 +288,7 @@ cmdModuleReset cmdModuleRestore cmdModuleSearch cmdModuleStash +cmdModuleStashclear cmdModuleStashpop cmdModuleStashrm cmdModuleStashshow diff --git a/tcl/main.tcl.in b/tcl/main.tcl.in index fba547bc..9fc062d7 100644 --- a/tcl/main.tcl.in +++ b/tcl/main.tcl.in @@ -108,7 +108,7 @@ proc parseModuleCommandName {command defaultcmd} { initlist initclear autoinit clear config help test prepend-path\ append-path remove-path is-loaded is-saved is-used is-avail info-loaded\ sh-to-mod edit try-load refresh state load-any lint mod-to-sh reset\ - stash stashpop stashrm stashshow]}] + stash stashpop stashrm stashshow stashclear]}] reportDebug "(command=$command, cmdvalid=$cmdvalid, cmdempty=$cmdempty)" return [list $command $cmdvalid $cmdempty] @@ -373,7 +373,8 @@ proc module {command args} { path - paths - autoinit - help - prepend-path - append-path -\ remove-path - is-loaded - is-saved - is-used - is-avail -\ info-loaded - clear - sh-to-mod - edit - refresh - source - state -\ - lint - mod-to-sh - reset - stash - stashpop - stashrm - stashshow { + lint - mod-to-sh - reset - stash - stashpop - stashrm - stashshow -\ + stashclear { knerror "${msgprefix}Command '$command' not supported$tryhelpmsg" } } @@ -398,7 +399,7 @@ proc module {command args} { } } refresh - reload - aliases - purge - initlist - initclear - autoinit -\ - reset - stash { + reset - stash - stashclear { if {[llength $args] != 0} { set argnberr 1 } @@ -732,6 +733,9 @@ proc module {command args} { stashshow { cmdModuleStashshow {*}$args } + stashclear { + cmdModuleStashclear + } help { cmdModuleHelp {*}$args } diff --git a/tcl/report.tcl.in b/tcl/report.tcl.in index 9b34e570..b2fb7087 100644 --- a/tcl/report.tcl.in +++ b/tcl/report.tcl.in @@ -1778,7 +1778,7 @@ See 'module --help' to get available commands and options.} proc reportUsage {} { reportVersion - ##nagelfar ignore #104 Too long line + ##nagelfar ignore #105 Too long line report {Usage: module [options] [command] [args ...] Loading / Unloading commands: @@ -1817,6 +1817,7 @@ Collection of modules handling commands: stashpop [stash] Restore then remove stash collection stashrm [stash] Remove stash collection stashshow [stash] Display information about stash collection + stashclear Remove all stash collections Environment direct handling commands: prepend-path [-d c] var val [...] Prepend value to environment variable diff --git a/tcl/subcmd.tcl.in b/tcl/subcmd.tcl.in index f3716c8e..a0b77ed8 100644 --- a/tcl/subcmd.tcl.in +++ b/tcl/subcmd.tcl.in @@ -2819,6 +2819,9 @@ proc cmdModuleStashshow {{stash 0}} { cmdModuleSaveshow $coll } +proc cmdModuleStashclear {} { +} + # ;;; Local Variables: *** # ;;; mode:tcl *** # ;;; End: ***