Exemplo n.º 1
0
 def make_parser(parser=None):
     if not parser:
         parser = BaseTop.make_parser()
     parser.add_argument('--assert',
                         '--assert-mode',
                         default=False,
                         dest='assert_mode',
                         help='Stops running after errors detected.')
     parser.add_argument('--dev',
                         '--devices',
                         default="",
                         dest='devices',
                         help='Comma-separated list of devices to monitor.')
     parser.add_argument('--device-regex',
                         default='^.*$',
                         help="Regex-mask for devices to monitor.")
     parser.add_argument(
         '-s',
         '--simple',
         default=False,
         dest='simple_mode',
         action='store_true',
         help=
         'Hides different kinds of error, showing only general counters.')
     parser.add_argument('--rx',
                         '--rx-only',
                         dest='rx_only',
                         default=False,
                         action='store_true',
                         help='Hides tx-counters')
     parser.add_argument('--bits', default=False, action='store_true')
     parser.add_argument('--bytes', default=False, action='store_true')
     parser.add_argument('--kbits', default=False, action='store_true')
     parser.add_argument('--mbits', default=True, action='store_true')
     return parser
Exemplo n.º 2
0
 def make_parser(parser=None):
     if not parser:
         parser = BaseTop.make_parser()
     parser.add_argument('--interrupts-file',
                         default='/proc/interrupts',
                         help='Option for testing on MacOS purpose.')
     return parser
Exemplo n.º 3
0
 def parse_options(self):
     """ Tricky way to gather all options in one util without conflicts, parse them and do some logic after parse """
     parser = BaseTop.make_parser()
     for top in itervalues(self.tops):
         parser = top.make_parser(parser)
     self.options = parser.parse_args()
     for top in itervalues(self.tops):
         top.options = self.options
         if hasattr(top, 'post_optparse'):
             top.post_optparse()
Exemplo n.º 4
0
 def make_parser(parser=None):
     if not parser:
         parser = BaseTop.make_parser()
     parser.add_argument('--softnet-stat-file', default='/proc/net/softnet_stat',
                         help='Option for testing on MacOS purpose.')
     return parser