Commits

Danny Navarro  committed 6340480

Add option for starting header. See #1

  • Participants
  • Parent commits bd55d77

Comments (0)

Files changed (1)

File src/trac2rst/core.py

             return ''
 
         # Process Headers
-        for exp, top, botton in HEADERS:
+        for exp, top, botton in HEADERS[:self.options.starting_header]:
             match = exp.match(line)
             if match:
                 result = wrap(match.group('header'), top=top, botton=botton)
                   dest="tracurl",
                   default='',
                   help="Trac url. Used for tickets, changeset and wiki links")
+    parser.add_option("-s", "--starting-header",
+                  type="int",
+                  dest="starting_header",
+                  default=0,
+                  help="Set starting header level",
+                  action="store")
+
     (options, args) = parser.parse_args()
 
     logging.basicConfig(level=logging.WARNING, stream=sys.stderr)