Skip to content

Commit 0e1652c

Browse files
committed
Update toggle-workspace.sh for "on", "off" args
Seems more natural than the original interface, actually.
1 parent 4f3bddb commit 0e1652c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/toggle-workspace.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ usage() {
1818
local lines=()
1919
while IFS='' read line; do
2020
if [[ "${line:0:1}" != '#' ]]; then
21-
printf '%s\n' "Usage: $0 [ disable | restore ]" "${lines[@]:1}" >&2
21+
printf '%s\n' "Usage: $0 [ on | off | restore ]" "${lines[@]:1}" >&2
2222
exit "$1"
2323
fi
2424
lines+=("${line:2}")
@@ -42,7 +42,7 @@ update_bazelrc_files() {
4242
local enabled_options="$workspace_options"
4343
local disabled_options="$bzlmod_options"
4444

45-
if [[ "$mode" == "disable" ]]; then
45+
if [[ "$mode" == "off" ]]; then
4646
enabled_options="$bzlmod_options"
4747
disabled_options="$workspace_options"
4848
fi
@@ -115,12 +115,12 @@ get_bazelrc_files_by_status() {
115115
done < <(git status -s '.bazelrc' '**/.bazelrc')
116116
}
117117

118-
if [[ "$#" -gt 1 ]]; then
118+
if [[ "$#" -ne 1 ]]; then
119119
usage 1
120120
fi
121121

122122
case "$1" in
123-
""|disable)
123+
on|off)
124124
update_bazelrc_files "$1"
125125
;;
126126
restore)

0 commit comments

Comments
 (0)