aboutsummaryrefslogtreecommitdiff
path: root/xtopen
diff options
context:
space:
mode:
authorJohn Ankarstrom <john@ankarstrom.se>2021-06-29 21:40:14 +0200
committerJohn Ankarstrom <john@ankarstrom.se>2021-06-29 21:40:14 +0200
commite6a259ee963d9ccf993c957c0687ea8231f14bf4 (patch)
tree0d19c5efa6ccb212351801e47519871a40571d95 /xtopen
parent1576639e6aed9ac98ba9c43dbc34123a6f45d25d (diff)
downloadxutil-e6a259ee963d9ccf993c957c0687ea8231f14bf4.tar.gz
xtopen: Replace all options with general -o and -p options
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 "$@"