diff options
author | John Ankarstrom <john@ankarstrom.se> | 2021-06-29 21:40:14 +0200 |
---|---|---|
committer | John Ankarstrom <john@ankarstrom.se> | 2021-06-29 21:40:14 +0200 |
commit | e6a259ee963d9ccf993c957c0687ea8231f14bf4 (patch) | |
tree | 0d19c5efa6ccb212351801e47519871a40571d95 /xtopen | |
parent | 1576639e6aed9ac98ba9c43dbc34123a6f45d25d (diff) | |
download | xutil-e6a259ee963d9ccf993c957c0687ea8231f14bf4.tar.gz |
xtopen: Replace all options with general -o and -p options
Diffstat (limited to 'xtopen')
-rwxr-xr-x | xtopen | 30 |
1 files changed, 8 insertions, 22 deletions
@@ -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 "$@" |