From cbd6bbc7b14ba82c7df6dda89f7d54adf91c1ebc Mon Sep 17 00:00:00 2001 From: Christopher Bennett <103678544+YourPCChris@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:38:07 +0000 Subject: [PATCH] Update vtcheck Switch case instead of many if statements? --- scripts/vtscan/vtcheck | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/scripts/vtscan/vtcheck b/scripts/vtscan/vtcheck index 0bb514b..7d6d7ba 100755 --- a/scripts/vtscan/vtcheck +++ b/scripts/vtscan/vtcheck @@ -33,21 +33,23 @@ def parse_args exit 0 end - if args.include? 'f' + case args.include? + + when 'f' @resource_url = @api_path['file'] - @options['file'] = true - end - if args.include? 'u' + @options['file] = true + + when 'u' @resource_url = @api_path['url'] @options['url'] = true - end - if args.include? 'v' - @options['verbose'] = true - end - if args.include? 'p' + + when 'v' + @options['verbos'] = true + + when 'p' @options['permalink'] = true - end - if args.include? '?' + + when '?' print_usage end