File: CheckManpage.py

package info (click to toggle)
ledger 3.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,964 kB
  • sloc: cpp: 39,393; python: 4,476; perl: 1,309; sh: 477; lisp: 435; yacc: 103; makefile: 58
file content (28 lines) | stat: -rwxr-xr-x 862 bytes parent folder | download
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
#!/usr/bin/env python3

import sys
import re
import os
import argparse

from os.path import *
from subprocess import Popen, PIPE

from CheckOptions import CheckOptions

class CheckManpage (CheckOptions):
  def __init__(self, args):
    CheckOptions.__init__(self, args)
    self.option_pattern = r'^\.It Fl \\-([-A-Za-z]+)'
    self.function_pattern = r'^\.It Fn ([-A-Za-z_]+)'
    self.symbol_pattern = r'^\.It Sy ([-A-Za-z_]+)'
    self.source_file = join(self.source, 'doc', 'ledger.1')
    self.source_type = 'manpage'

if __name__ == "__main__":
  args = argparse.ArgumentParser(prog='CheckManpage',
                                 description='Check that ledger options are documented in the manpage',
                                 parents=[CheckManpage.parser()]).parse_args()
  script = CheckManpage(args)
  status = script.main()
  sys.exit(status)