aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-08-13 09:31:41 -0300
committerEuAndreh <eu@euandre.org>2022-08-13 09:31:41 -0300
commit71ac64824affb7474007e81507a91bb266028072 (patch)
treecd59b9065ac50b3e4c6a8c6d29423762594f4450
parentbin/grun: Improve help string (diff)
downloaddotfiles-71ac64824affb7474007e81507a91bb266028072.tar.gz
dotfiles-71ac64824affb7474007e81507a91bb266028072.tar.xz
bin/m: Add working utility
-rwxr-xr-xbin/m64
1 files changed, 64 insertions, 0 deletions
diff --git a/bin/m b/bin/m
new file mode 100755
index 0000000..43b1ad6
--- /dev/null
+++ b/bin/m
@@ -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