]> us-delaporte.pagekite.me Git - minion.git/blobdiff - bin/moa
Fix for gather command
[minion.git] / bin / moa
diff --git a/bin/moa b/bin/moa
index 0978a65d3a37bb062186e5abafdfc13880d384f5..f66c00e4256fff061912e69c48b5f082cdef7340 100755 (executable)
--- a/bin/moa
+++ b/bin/moa
@@ -1,7 +1,13 @@
-#!/usr/bin/bash
+#!/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")
 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
 if [ -z ${EDITOR} ]; then
        echo "EDITOR unset, defaulting to Nano"
        export EDITOR=nano
 fi
-$EDITOR $files
+$EDITOR $files $more_files