[Synopsis-changes] Synopsis/Synopsis/bin synopsis,1.4,1.5

Stefan Seefeld stefan at synopsis.fresco.org
Wed Dec 10 05:20:40 UTC 2003


Update of /cvs/synopsis/Synopsis/bin
In directory frida:/tmp/cvs-serv4290/bin

Modified Files:
	synopsis 
Log Message:
add javadoc option and other enhancements

Index: synopsis
===================================================================
RCS file: /cvs/synopsis/Synopsis/bin/synopsis,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -d -r1.4 -r1.5
--- synopsis	9 Dec 2003 21:27:19 -0000	1.4
+++ synopsis	10 Dec 2003 05:20:38 -0000	1.5
@@ -41,14 +41,16 @@ List of options:
   -v  --verbose          operate verbosely
   -d  --debug            operate in debug mode
   -o, --output           output file / directory
-  -p, --parser           Select a parser
-  -Wp,<arg>[,<arg>...]   Send args to the parser
-  -l, --linker           Link
-  -Wl,<arg>[,<arg>...]   Send args to the linker
-  -f, --formatter        Select a formatter
-  -Wf,<arg>[,<arg>...]   Send args to the formatter
-  -I <path>              Specify include path
-  -D <macro>             Specify macro for the parser
+  -p, --parser           select a parser
+  -Wp,<arg>[,<arg>...]   send args to the parser
+  -l, --linker           link
+  -Wl,<arg>[,<arg>...]   send args to the linker
+  -f, --formatter        select a formatter
+  -Wf,<arg>[,<arg>...]   send args to the formatter
+  -I <path>              specify include path
+  -D <macro>             specify macro for the parser
+
+  -j  --javadoc          process javadoc tags in comments
 """
    
 def get_opt(argv):
@@ -64,18 +66,21 @@ def get_opt(argv):
    options = {}
    help = False
 
+   javadoc = False
+
    opts, args = getopt.getopt(argv,
-                              'o:p:l:f:I:D:W:vhVd',
+                              'o:p:l:f:I:D:W:jvhVd',
                               ['output=',
                                'parser=', 'linker=', 'formatter=',
-                               'version', 'help', 'verbose'])
+                               'version', 'help', 'verbose',
+                               'javadoc'])
 
    for o, a in opts:
-      if o == '-v' or o == '--version':
+      if o == '-V' or o == '--version':
          print 'synopsis version %s'%config.version
          sys.exit(0)
          
-      if o == '--verbose':
+      if o == '-v' or o == '--verbose':
          options['verbose'] = True
 
       elif o == '-o' or o == '--output':
@@ -88,7 +93,7 @@ def get_opt(argv):
       elif o == '-l' or o == '--linker':
          linker = __import__('Synopsis.Processors.Linker',
                              'verbose' in options)
-         linker_opts['processors'] = map(lambda x: __import__('Synopsis.Processors.%s.%s'%(x, x),
+         linker_opts['processors'] = map(lambda x: __import__('Synopsis.Processors.%s'%x,
                                                               'verbose' in options)(),
                                          string.split(a, ','))
 
@@ -115,6 +120,9 @@ def get_opt(argv):
       elif o == '-h' or o == '--help':
          help = True
 
+      elif o == '-j' or o == '--javadoc':
+         javadoc = True
+
    if help:
       for p in parser, linker, formatter:
          if not p: continue
@@ -137,7 +145,17 @@ def get_opt(argv):
    if linker:
       processors.append(linker(**linker_opts))
    if formatter:
+
+      if string.split(formatter.__module__, '.')[-2] == 'HTML':
+         #treat frequent flags at this level for convenience
+         if javadoc:
+            from Synopsis.Formatters.HTML import Comments
+            # add javadoc to the default list of comment formatters
+            formatter_opts['comment_formatters'] = [Comments.QuoteHTML(),
+                                                    Comments.Section(),
+                                                    Comments.Javadoc()]
       processors.append(formatter(**formatter_opts))
+
    processor = Composite(*processors, **options)
 
    return processor





More information about the Synopsis-changes mailing list