From 71bd548ca237675348ac25b622f1896898cd078d Mon Sep 17 00:00:00 2001 From: milancurcic Date: Fri, 24 Jul 2020 12:23:50 -0400 Subject: use select case and trim cmdarg --- fpm/app/main.f90 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fpm/app/main.f90 b/fpm/app/main.f90 index 8533f8c..ad1a9e0 100644 --- a/fpm/app/main.f90 +++ b/fpm/app/main.f90 @@ -7,12 +7,13 @@ if (command_argument_count() == 0) then call print_help() else if (command_argument_count() == 1) then call get_command_argument(1, cmdarg) - if (cmdarg == "build") then - call cmd_build() - else - print *, "Unknown command: ", cmdarg - error stop - end if + select case(trim(cmdarg)) + case("build") + call cmd_build() + case default + print *, "Unknown command: ", cmdarg + error stop + end select else print *, "Too many arguments" error stop -- cgit v1.2.3