diff options
author | milancurcic <caomaco@gmail.com> | 2020-07-24 12:23:50 -0400 |
---|---|---|
committer | milancurcic <caomaco@gmail.com> | 2020-07-24 12:23:50 -0400 |
commit | 71bd548ca237675348ac25b622f1896898cd078d (patch) | |
tree | 6e28e02acf9fceb286c08ed22984bf5f64240339 | |
parent | f80924c65f9e73ca76e5f6c32699ea378d4ee62b (diff) | |
download | fpm-71bd548ca237675348ac25b622f1896898cd078d.tar.gz fpm-71bd548ca237675348ac25b622f1896898cd078d.zip |
use select case and trim cmdarg
-rw-r--r-- | fpm/app/main.f90 | 13 |
1 files 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 |