]> us-delaporte.pagekite.me Git - minion.git/commitdiff
Add option to open an unrelated search term
authorEdward Delaporte <edward@delaporte.us>
Thu, 18 Jun 2026 02:10:47 +0000 (21:10 -0500)
committerEdward Delaporte <edward@delaporte.us>
Thu, 18 Jun 2026 02:10:47 +0000 (21:10 -0500)
bin/mo
bin/moa

diff --git a/bin/mo b/bin/mo
index 33f25d46b5ee32ac0288348feecd5727f9637d4f..7d0e7cd6a71afa2f4ce4bce69f3246c9a66f63ac 100755 (executable)
--- a/bin/mo
+++ b/bin/mo
@@ -1,10 +1,14 @@
 #!/bin/bash
 # mo - minion open
 # Like `ml / minion list`, but opens all matches in your $EDITOR
+# Optionally search a second term - to quickly open differently named files
 year=`date +%Y`
 files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md")
+if [ -n "$2" ]; then
+       more_files=$(find $HOME/Journal/$year -type f -iname "*$2*\.md")
+fi
 if [ -z ${EDITOR} ]; then
        echo "EDITOR unset, defaulting to Nano"
        export EDITOR=nano
 fi
-$EDITOR $files
+$EDITOR $files $more_files
diff --git a/bin/moa b/bin/moa
index dbed63b42b7485b56cccf3a394fcbb2a0728fa99..f66c00e4256fff061912e69c48b5f082cdef7340 100755 (executable)
--- a/bin/moa
+++ b/bin/moa
@@ -1,9 +1,13 @@
 #!/bin/bash
 # moa - minion open any
 # Like `mla / minion list any`, but opens all matches in your $EDITOR
+# Optionally search a second term - to quickly open differently named files
 files=$(find $HOME/Journal -type f -iname "*$1*\.md")
+if [ -n "$2" ]; then
+       more_files=$(find $HOME/Journal -type f -iname "*$2*\.md")
+fi
 if [ -z ${EDITOR} ]; then
        echo "EDITOR unset, defaulting to Nano"
        export EDITOR=nano
 fi
-$EDITOR $files
+$EDITOR $files $more_files