fix: [ and ==, sh-agnostic

This commit is contained in:
2026-06-02 13:52:37 +02:00
parent a498706ff0
commit 0bd35bd8b1
+3 -3
View File
@@ -1,4 +1,4 @@
std::mod::init clap 0.1.0
std::mod::init clap 0.1.1
##
# must be called after declaring a `clap__flags` as associative arrays, where:
@@ -81,11 +81,11 @@ clap::parse() {
}
clap::flag::is-short() {
[ "${1:0:1}" == "-" ] && [ "${1:1:1}" != "-" ]
[[ "${1:0:1}" == "-" ]] && [[ "${1:1:1}" != "-" ]]
}
clap::flag::is-long() {
[ "${1:0:1}" == "-" ] && [ "${1:1:1}" == "-" ]
[[ "${1:0:1}" == "-" ]] && [[ "${1:1:1}" == "-" ]]
}
##