diff options
author | EuAndreh <eu@euandre.org> | 2022-08-13 09:31:41 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-08-13 09:31:41 -0300 |
commit | 71ac64824affb7474007e81507a91bb266028072 (patch) | |
tree | cd59b9065ac50b3e4c6a8c6d29423762594f4450 | |
parent | bin/grun: Improve help string (diff) | |
download | dotfiles-71ac64824affb7474007e81507a91bb266028072.tar.gz dotfiles-71ac64824affb7474007e81507a91bb266028072.tar.xz |
bin/m: Add working utility
-rwxr-xr-x | bin/m | 64 |
1 files changed, 64 insertions, 0 deletions
@@ -0,0 +1,64 @@ +#!/bin/sh +set -eu + +usage() { + cat <<-'EOF' + Usage: + m + m -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + + + Fetch email via IMAP and update the notmuch index. + + + Examples: + + Just fetch email + + $ m + EOF +} + + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + + +notmuch new +mbsync -a +notmuch new |