aboutsummaryrefslogtreecommitdiff
path: root/xtopen
diff options
context:
space:
mode:
Diffstat (limited to 'xtopen')
-rwxr-xr-xxtopen30
1 files changed, 8 insertions, 22 deletions
diff --git a/xtopen b/xtopen
index 3b698a8..816b620 100755
--- a/xtopen
+++ b/xtopen
@@ -14,20 +14,16 @@ abbr() {
if [ $# -eq 0 ]; then
xmessage -buttons sorry:0 -default sorry -nearmouse \
- "usage: $0 [-i] [-k] [-K] [-u] cmd ..."
+ "usage: $0 [-o xterm-opt] [-p prefix] cmd ..."
exit 1
fi
-i=
-k=
-K=
-u=
-while getopts ikKu o; do
- case $o in
- i) i=1 ;;
- K) K=1 ;;
- k) k=1 ;;
- u) u=1 ;;
+o=
+p=
+while getopts o:p: opt; do
+ case $opt in
+ o) o=$OPTARG ;;
+ p) p=$OPTARG ;;
?) xmessage -buttons sorry:0 -default sorry -nearmouse \
error: "unknown flag $1"
exit 1 ;;
@@ -41,14 +37,4 @@ if ! which "$1" >/dev/null; then
exit 1
fi
-prefix=
-
-[ ! -z "$i" ] && prefix=$prefix\ iso8859-1
-[ ! -z "$u" ] && prefix=$prefix\ utf8
-
-case "$k,$K" in
-1,*) prefix=$prefix\ with-shell ;;
-*,1) prefix=$prefix\ with-shell-on-error ;;
-esac
-
-exec xterm -title "$* (`abbr "$PWD"`)" -e $prefix "$@"
+exec xterm -title "$* (`abbr "$PWD"`)" $o -e $p "$@"