]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/MKkeys_list.sh
ncurses 6.2 - patch 20210508
[ncurses.git] / ncurses / tinfo / MKkeys_list.sh
index b669eecce3aa60271e860e8814323e62a6f3328c..3b8beaee56f3aacf157ae0f41def67b3a255cc9e 100755 (executable)
@@ -1,7 +1,8 @@
 #! /bin/sh
-# $Id: MKkeys_list.sh,v 1.5 2017/08/12 12:22:06 tom Exp $
+# $Id: MKkeys_list.sh,v 1.7 2020/02/02 23:34:34 tom Exp $
 ##############################################################################
-# Copyright (c) 2001-2003,2017 Free Software Foundation, Inc.                #
+# Copyright 2019,2020 Thomas E. Dickey                                       #
+# Copyright 2001-2003,2017 Free Software Foundation, Inc.                    #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
 # Extract function-key names from the Caps file
 #
 : ${AWK-awk}
-DATA=${1-../../include/Caps}
+if test $# != 0
+then
+       DATA="$*"
+else
+       DATA=../../include/Caps
+fi
 
 data=data$$
-trap 'rm -f $data' 0 1 2 3 15
-sed -e 's/[    ][      ]*/     /g' < $DATA >$data
+trap 'rm -f $data' EXIT INT QUIT TERM HUP
+cat $DATA | sed -e 's/[        ][      ]*/     /g' >$data
 
 cat <<EOF
 # These definitions were generated by $0 $DATA
@@ -53,6 +59,7 @@ ${AWK-awk} <$data '
 /^#/           {next;}
 /^capalias/    {next;}
 /^infoalias/   {next;}
+/^userdef/     {next;}
 
 $5 != "-" {
                if (substr($5, 1, 4) == "KEY_" ) {