few updates
[wmaker-crm.git] / util / wpaste
blob88a855075f26ffebf6cece34ddba7a491d45c410
1 #!/bin/sh
3 # Provide some enhancements to the wxpaste command, which pastes from X11
4 # clipboard text buffers to standard output.
6 # Allow pasting to stdout from any of the cutbuffers. Note that they are
7 # indexed counting from 0.
9 # Author: Luke Kendall
12 if [ $# = 0 ]
13 then
14 wxpaste $WXPASTE_DEFS
15 else
16 MYNAME=`basename $0`
17 USAGE="usage: $MYNAME [ [0-9]... ] [wxpaste's args]"
18 for n
20 if expr "x$n" : 'x[0-9][0-9]*$' > /dev/null
21 then
22 NUMARGS="$NUMARGS $n"
23 elif [ "x$n" = "x-h" ]
24 then
25 echo "$USAGE" >&2
26 exit 0
27 else
28 WXARGS="$WXARGS $n"
30 done
31 set - $NUMARGS
32 for n
34 wxpaste $WXPASTE_DEFS $WXARGS -cutbuffer $n
35 done