Browse Source

Spelling fixes.

Carlos Garcia 6 years ago
parent
commit
69536f239e
2 changed files with 15 additions and 15 deletions
  1. 11 11
      code/CLI.py
  2. 4 4
      code/ID2TLib/Statistics.py

+ 11 - 11
code/CLI.py

@@ -58,37 +58,37 @@ class CLI(object):
         """
         # Create parser for arguments
         parser = argparse.ArgumentParser(description="Intrusion Detection Dataset Toolkit (ID2T) - A toolkit for "
-                                         "injection of synthetically created attacks into PCAP datasets.",
+                                         "injecting synthetically created attacks into PCAP files.",
                                          prog="id2t")
         # Define required arguments
         requiredNamed = parser.add_argument_group('required named arguments')
-        requiredNamed.add_argument('-i', '--input', metavar="FILEPATH", help='path to the input pcap file', required=True)
+        requiredNamed.add_argument('-i', '--input', metavar="PCAP_FILE", help='path to the input pcap file', required=True)
 
         # Define optional arguments
-        parser.add_argument('-c', '--config', metavar='FILEPATH', help='file containing parameters used as input.',
+        parser.add_argument('-c', '--config', metavar='CONFIG_FILE', help='file containing configuration parameters.',
                             action=LoadFromFile, type=open)
         parser.add_argument('-e', '--export',
-                            help='stores the statistics as a textfile with ending .stat into the dataset directory',
+                            help='store statistics as a ".stat" file',
                             action='store_true', default=False)
-        parser.add_argument('-a', '--attack', metavar="ATTACKNAME", action='append',
-                            help='injects a new attack into the given dataset.', nargs='+')
+        parser.add_argument('-a', '--attack', metavar="ATTACK", action='append',
+                            help='injects an ATTACK into a PCAP file.', nargs='+')
         parser.add_argument('-r', '--recalculate',
-                            help='forces to recalculate the statistics in case of an already existing statistics database.',
+                            help='recalculate statistics even if a cached version exists.',
                             action='store_true', default=False)
-        parser.add_argument('-s', '--statistics', help='print general file statistics to stdout.', action='store_true',
+        parser.add_argument('-s', '--statistics', help='print file statistics to stdout.', action='store_true',
                             default=False)
-        parser.add_argument('-p', '--plot', help='creates a plot of common dataset statistics', action='append',
+        parser.add_argument('-p', '--plot', help='creates statistics plots.', action='append',
                             nargs='?')
         parser.add_argument('-q', '--query', metavar="QUERY",
                             action='append', nargs='?',
-                            help='queries the statistics database. If no query is provided, the application enters into query mode.')
+                            help='query the statistics database. If no query is provided, the application enters query mode.')
 
         # Parse arguments
         self.args = parser.parse_args(args)
 
         # Either PCAP filepath or GUI mode must be enabled
         if not self.args.input:
-            parser.error("Parameter -i/--input required. See available options with -h/--help ")
+            parser.error("Parameter -i/--input required. See available options with -h/--help")
 
         self.process_arguments()
 

+ 4 - 4
code/ID2TLib/Statistics.py

@@ -46,7 +46,7 @@ class Statistics:
         if flag_recalculate_stats:
             print("Flag -r/--recalculate found. Recalculating statistics.")
 
-        # Recalculate statistics if database not exists OR param -r/--recalculate was provided
+        # Recalculate statistics if database does not exist OR param -r/--recalculate is provided
         if (not self.stats_db.get_db_exists()) or flag_recalculate_stats:
             self.pcap_proc = pr.pcap_processor(self.pcap_filepath)
             self.pcap_proc.collect_statistics()
@@ -76,7 +76,7 @@ class Statistics:
         :return: a list of tuples, each consisting of (description, value, unit), where unit is optional.
         """
         return [("Pcap file", self.pcap_filepath),
-                ("#Packets", self.get_packet_count(), "packets"),
+                ("Packets", self.get_packet_count(), "packets"),
                 ("Capture length", self.get_capture_duration(), "seconds"),
                 ("Capture start", self.get_pcap_timestamp_start()),
                 ("Capture end", self.get_pcap_timestamp_end())]
@@ -285,7 +285,7 @@ class Statistics:
 
     def plot_statistics(self, format: str = 'png'):
         """
-        Plots the statistics associated with the dataset prior attack injection.
+        Plots the statistics associated with the dataset.
         :param format: The format to be used to save the statistics diagrams.
         """
 
@@ -309,4 +309,4 @@ class Statistics:
             return out
 
         out_path = plot_ttl('.' + format)
-        print("Saved TTL distribution plot at: ", out_path)
+        print("Saved TTL distribution plot in: ", out_path)