summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cmd.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd.sh b/src/cmd.sh
index 5ec67bf..1ed69b2 100644
--- a/src/cmd.sh
+++ b/src/cmd.sh
@@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-cmds=
+cmds=' '
register_cmd()
{
@@ -96,7 +96,8 @@ is_cmd()
{
local cmd="${1}"
- [ "x$(printf '%s\n' ${cmds} | grep "^${cmd}$")" = "x${cmd}" ]
+ case "${cmds}" in *" ${cmd} "*) return 0;; esac
+ return 1
}
run_cmd()