Skip to content

Commit 0ceb2bc

Browse files
committed
Fix -r flag bug
1 parent 4431bf3 commit 0ceb2bc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

notes

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,23 @@ new_note() {
108108

109109
remove_note() {
110110
local rm_args=()
111-
local files="$@"
111+
local len=${#@}
112112

113113
if [[ "$1" == "-r" || "$1" == "--recursive" ]]; then
114114
rm_args+=("--recursive")
115115
shift
116116
fi
117117

118-
for files; do
119-
local note_name="$*"
118+
len=${#@}
119+
for i in $(seq 1 $len); do
120+
local note_name="$1"
120121
local to_remove="$notes_dir/$note_name"
121122

122123
if [ -f "$notes_dir/$note_name$file_ext" ]; then
123124
to_remove="$notes_dir/$note_name$file_ext"
124125
fi
125126
rm "${rm_args[@]}" "$to_remove"
127+
shift
126128
done
127129
}
128130

@@ -144,7 +146,7 @@ open_something() {
144146
open_note() {
145147
local note_path
146148
local ext_check
147-
local buffer=$@
149+
local buffer=$@
148150
local files=()
149151

150152
IFS=','

0 commit comments

Comments
 (0)