diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cec52fb6b72a56664eab71cb391cf4b214af4c0..07834a07a92986a9945a5a5b303926f5f8df153b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +## Bugfixes +* `iocsh.bash --help` (and variants) no longer loads tries to load `env.sh`. + ## [3.4.1] ### Bugfixes diff --git a/configure/E3/RULES_REQUIRE b/configure/E3/RULES_REQUIRE index c1f9f6a6c399665e1e737747e9bfab47219cc140..4832a232eb0db0c7821c3fefcbeb4c9b8ba40ff6 100644 --- a/configure/E3/RULES_REQUIRE +++ b/configure/E3/RULES_REQUIRE @@ -15,7 +15,7 @@ E3_CONFIG_FILE := $(TOP)/tools/e3.cfg E3_TEST_SCRIPT := $(TOP)/tools/test_installed_modules.sh # E3_SHELL_FILES := $(wildcard $(E3_MODULE_SRC_PATH)/tools/iocsh*.bash) -E3_IOC_CFG_FILES := $(E3_MODULE_SRC_PATH)/tools/iocsh_functions +#E3_IOC_CFG_FILES := $(E3_MODULE_SRC_PATH)/tools/iocsh_functions E3_IOC_CFG_FILES += $(E3_ESSENVCFG_FILE) #E3_IOC_CFG_FILES += $(E3_CONFIG_FILE) E3_IOC_CFG_FILES += $(E3_MODULE_SRC_PATH)/tools/setE3Env.bash diff --git a/require-ess/tools/iocsh.bash b/require-ess/tools/iocsh.bash index 59d0c40fa53bab5636c28e3399c5aa4780d7a123..22629f7d245806f8004cca33c1646c9a17be17a8 100755 --- a/require-ess/tools/iocsh.bash +++ b/require-ess/tools/iocsh.bash @@ -52,7 +52,7 @@ declare STARTUP="" declare BASECODE="" declare -r TMP_PATH="/tmp/systemd-private-e3-iocsh-$(whoami)" -. ${SC_TOP}/iocsh_functions +. ${SC_TOP}/iocsh_functions.bash # To get the absolute path where iocsh.bash is executed diff --git a/require-ess/tools/iocsh_functions b/require-ess/tools/iocsh_functions.bash similarity index 97% rename from require-ess/tools/iocsh_functions rename to require-ess/tools/iocsh_functions.bash index 1c1ce73ecbbb984381a86b61ccd08434433425b5..304c930e985dc68c60bd55b66ee69f68e9fbbae1 100644 --- a/require-ess/tools/iocsh_functions +++ b/require-ess/tools/iocsh_functions.bash @@ -331,6 +331,7 @@ function check_mandatory_env_settings() { function loadEnv() { local envfile=$IOCSH_TOP/env.sh + local warn=false while [ $# -gt 0 ]; do arg=$1 @@ -338,6 +339,7 @@ function loadEnv() { -e) shift envfile=$1 + warn=true ;; esac shift @@ -346,7 +348,7 @@ function loadEnv() { if [ -f "$envfile" ]; then echo "Loading environment variables from $envfile" source "$envfile" - else + elif [ "$warn" = true ]; then echo "Warning: environment file $envfile does not exist." >&2 fi } @@ -357,12 +359,6 @@ function loadFiles() { file=$1 case $file in - -h | "-?" | -help | --help) - help - ;; - -v | -ver | --ver | -version | --version) - version - ;; -rt | -RT | -realtime | --realtime) REALTIME="RT" __LOADER__="chrt --fifo 1 " @@ -417,6 +413,10 @@ function loadFiles() { -e) shift ;; + -n) + __LOADER__="nice --10 " + shift + ;; -*) printf "Unknown option $1\n\n" >&2 help @@ -494,11 +494,15 @@ function help() { printf "Options:\n\n" printf " -?, -h, --help Show this page and exit.\n" printf " -v, --version Show version and exit.\n" + printf " -e env_file, Load a given environment file 'env_file'.\n" printf " -c 'cmd args' Ioc shell command.\n" printf " -l 'cell path' Run Ioc with a cell path.\n" printf " -s 'prog m=v' Sequencer program (and arguments), run with 'seq'.\n" printf " This forces an 'iocInit' before running the program.\n" printf " -r module[,ver] Modue (optionally with version) loaded via 'require'.\n" + printf " -dg Run with debugger gdb.\n" + printf " -dv Run with valgrind.\n" + printf " @file More arguments are read from file.\n\n" printf "Supported filetypes:\n\n" printf " *.db, *.dbt, *.template loaded via 'dbLoadRecords'\n" @@ -517,3 +521,15 @@ function help() { } >&2 exit } + +for arg in "$@"; do + case $arg in + -h | "-?" | -help | --help) + help + ;; + -v | -ver | --ver | -version | --version) + version + ;; + *) ;; + esac +done \ No newline at end of file