Skip to content

Instantly share code, notes, and snippets.

@mrdomino
Last active April 27, 2016 14:20
Show Gist options
  • Save mrdomino/5cee55628898cdfdaa87a60f7464e66a to your computer and use it in GitHub Desktop.
Save mrdomino/5cee55628898cdfdaa87a60f7464e66a to your computer and use it in GitHub Desktop.
#!/bin/sh
# usage: flag <flag> [args...]
# e.g.: flag --foo= x y z
# --foo=x --foo=y --foo=z
trap "awk '/^# /' $(which $0) | cut -d' ' -f2-" EXIT
set -eu; flag=$1; shift; for arg in "$@"; do echo $flag$arg; done
exec true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment