~gpanders/dotfiles

2da1dde5ea566f82ebe6532bc6d3b8670fd77ce8 — Greg Anders 1 year, 6 months ago 5a00258
Note 'open' subcommand opens editor in NOTES_DIR when no argument given
1 files changed, 11 insertions(+), 12 deletions(-)

M note/.local/bin/note
M note/.local/bin/note => note/.local/bin/note +11 -12
@@ 54,20 54,19 @@ note() {
            cat "$note"
            ;;
        o|op|ope|open)
            cd "$NOTES_DIR" || return 1
            if [ $# -lt 2 ]; then
                usage >&2
                return 1
                ${EDITOR:-vi}
            else
                shift
                local notes
                notes=()
                for note in "$@"; do
                    notes+=("$NOTES_DIR"/"${note%.txt}".txt)
                done

                ${EDITOR:-vi} "${notes[@]}"
            fi

            shift
            local notes
            notes=()
            for note in "$@"; do
                notes+=("$NOTES_DIR"/"${note%.txt}".txt)
            done

            cd "$NOTES_DIR" || return 1
            ${EDITOR:-vi} "${notes[@]}"
            ;;
        n|ne|new)
            if [ $# -lt 2 ]; then