Skip to content

Commit

Permalink
Improved tool keys for better understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
nepJIywa committed Nov 22, 2018
1 parent b82a004 commit 656f001
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Windows:

Extended options:

`python3 ccat.py config_directory -vl vlmap.txt -o result_html_files_directory --storm_level 40.0 --max_number_mac 100 --disabled-interfaces --no-console-display --graph network_map`
`python3 ccat.py config_directory -vlanmap vlmap.txt -output result_html_files_directory --storm_level 40.0 --max_number_mac 100 --disabled-interfaces --no-console-display --graph network_map`

**config_directory** - path to directory with configuration files
**configs** - path to the configuration file or directory with configuration files

**-vl** - path to [vlanmap file](https://github.com/cisco-config-analysis-tool/ccat/wiki/Vlanmap-file)
**-vlanmap** - path to [vlanmap file](https://github.com/cisco-config-analysis-tool/ccat/wiki/Vlanmap-file)

**-o** - path to output html files directory
**-output** - path to output html files directory

**--storm_level** - appropriate level for storm-control (by default value = 80)

Expand Down
18 changes: 9 additions & 9 deletions args.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def getfilenames():
global args
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
description="Cisco Configuration Analysis Tool",
epilog='Usage example:\n ccat smth/config_folder -vl smth/vlanmap_file')
parser.add_argument("config", type=str, nargs='?', default=0, help="full path to the configuration file or folder with config(s)")
parser.add_argument("-vl", type=str, help="path to vlanmap (file that determine how critical is certain vlan, you can find example in 'example' folder)")
parser.add_argument("-o", type=str, help="path to output html files directory")
epilog='Usage example:\n ccat smth/config_folder -vlanmap smth/vlanmap_file')
parser.add_argument("configs", type=str, nargs='?', default=0, help="full path to the configuration file or folder with config(s)")
parser.add_argument("-vlanmap", type=str, help="path to vlanmap (file that determine how critical is certain vlan, you can find example in 'example' folder)")
parser.add_argument("-output", type=str, help="path to output html files directory")
parser.add_argument("--no-console-display", action='store_true', help="to output analysis results in html files directory or into network graph")
parser.add_argument("--no-ipv6", action='store_true', help="if you're not using IPv6")
parser.add_argument("--disabled-interfaces", action='store_true', help="check interfaces even if they are turned off")
Expand All @@ -57,10 +57,10 @@ def getfilenames():
graph_group = parser.add_argument_group('Network graph')
graph_group.add_argument("--graph", type=str, nargs='?', default=0, help="left the argument empty to get into interactive mode or define a file name for graph output in png extension")
args = parser.parse_args()
if not(args.config):
print ('Usage example:\n ccat smth/config_folder -vl smth/vlanmap_file\n\nFor more details try --help')
if not(args.configs):
print ('Usage example:\n ccat smth/config_folder -vlanmap smth/vlanmap_file\n\nFor more details try --help')
exit()
if args.no_console_display and not args.o and args.graph == 0:
print('\nYou should define html files directory with -o key OR use --graph key to use this options\n\nFor more details try --help')
if args.no_console_display and not args.output and args.graph == 0:
print('\nYou should define html files directory with -output key OR use --graph key to use this options\n\nFor more details try --help')
exit()
return _getargs___arg_parser(args.config, args.vl)
return _getargs___arg_parser(args.configs, args.vlanmap)
6 changes: 3 additions & 3 deletions ccat.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
# variables for html output option
html_directory = None
html_file = None
config_directory = args.args.config
config_directory = args.args.configs
# Create directory for html files output or check its existence
if args.args.o:
html_directory = args.args.o
if args.args.output:
html_directory = args.args.output
try:
os.makedirs(html_directory, exist_ok=True)
except OSError:
Expand Down

0 comments on commit 656f001

Please sign in to comment.