File: ginsh_fcn_help.sed

package info (click to toggle)
ginac 1.0.8-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,544 kB
  • ctags: 3,232
  • sloc: cpp: 27,732; sh: 7,126; perl: 1,819; yacc: 763; lex: 345; makefile: 221; sed: 32
file content (33 lines) | stat: -rw-r--r-- 466 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Convert help for ginsh functions from man page to C source
/GINSH_FCN_HELP_START/,/GINSH_FCN_HELP_END/{

# .BI lines contain the function synopsis
/\.BI/{

# extract function name
h
s/\.BI \(.*\)(.*/insert_help("\1",/p
g

# extract synopsis
s/"//g
s/ , /,/g
s/\.BI /"/
s/( /(/
s/ )/)"/
p
# handle multi-line synopsis
s/.br/);/p
}

# \- lines contain the function description
/\\-/{
s/"/'/g
s/\\-/" -/
s/$/"/
p
}

# .br lines start the next function
/.br/s//);/p
}