File: gengetopt.awk

package info (click to toggle)
gliv 1.9.7-2
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 5,780 kB
  • ctags: 4,039
  • sloc: ansic: 30,070; sh: 5,207; makefile: 740; yacc: 291; awk: 185; sed: 16
file content (20 lines) | stat: -rw-r--r-- 605 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
BEGIN {
    print "# Autogenerated by gengetopt.awk"
    print "purpose \"Image Viewer using OpenGL\"";
    print;
}

/^STR / {
    match($0, /^.*"(.*)".*"(.*)".*"(.*)".*"(.*)"/, array);
    printf "option \"%s\" %s \"%s\" string typestr=\"%s\" no\n", $2, $3, array[1], array[2];
}

/^OSTR / {
    match($0, /^.*"(.*)".*"(.*)".*"(.*)".*"(.*)"/, array);
    printf "option \"%s\" %s \"%s\" string typestr=\"%s\" no argoptional\n", $2, $3, array[1], array[2];
}

/^FLAG / {
    match($0, /"(.*)"/, array);
    printf "option \"%s\" %s \"%s\" string typestr=\"on|off\" no argoptional\n", $2, $3, array[1];
}