aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilancurcic <caomaco@gmail.com>2020-07-24 12:23:50 -0400
committermilancurcic <caomaco@gmail.com>2020-07-24 12:23:50 -0400
commit71bd548ca237675348ac25b622f1896898cd078d (patch)
tree6e28e02acf9fceb286c08ed22984bf5f64240339
parentf80924c65f9e73ca76e5f6c32699ea378d4ee62b (diff)
downloadfpm-71bd548ca237675348ac25b622f1896898cd078d.tar.gz
fpm-71bd548ca237675348ac25b622f1896898cd078d.zip
use select case and trim cmdarg
-rw-r--r--fpm/app/main.f9013
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