diff options
-rw-r--r-- | fpm/app/main.f90 | 23 | ||||
-rw-r--r-- | fpm/src/fpm.f90 | 34 |
2 files changed, 47 insertions, 10 deletions
diff --git a/fpm/app/main.f90 b/fpm/app/main.f90 index 8533f8c..361cae5 100644 --- a/fpm/app/main.f90 +++ b/fpm/app/main.f90 @@ -1,5 +1,5 @@ program main -use fpm, only: print_help, cmd_build +use fpm, only: print_help, cmd_build, cmd_install, cmd_new, cmd_run, cmd_test implicit none character(100) :: cmdarg @@ -7,14 +7,21 @@ 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("install") + call cmd_install() + case("new") + call cmd_new() + case("run") + call cmd_run() + case default + print *, "fpm error: No such command " // trim(cmdarg) + error stop 1 + end select else print *, "Too many arguments" - error stop + error stop 1 end if end program main diff --git a/fpm/src/fpm.f90 b/fpm/src/fpm.f90 index bd1a70e..aefbfd0 100644 --- a/fpm/src/fpm.f90 +++ b/fpm/src/fpm.f90 @@ -1,7 +1,7 @@ module fpm implicit none private -public :: print_help, cmd_build +public :: print_help, cmd_build, cmd_install, cmd_new, cmd_run, cmd_test integer, parameter :: OS_LINUX = 1 integer, parameter :: OS_MACOS = 2 @@ -105,7 +105,7 @@ close(u) end subroutine subroutine print_help() -print *, "Fortran Package Manager (fpm)" +print *, "fpm - A Fortran package manager and build system" select case (get_os_type()) case (OS_LINUX) print *, "OS Type: Linux" @@ -114,6 +114,16 @@ select case (get_os_type()) case (OS_WINDOWS) print *, "OS Type: Windows" end select +print * +print *, "Usage:" +print *, " fpm [COMMAND]" +print * +print *, "Valid fpm commands are:" +print *, " build Compile the current package" +print *, " install Install a Fortran binary or library (not implemented)" +print *, " new Create a new Fortran package (not implemented)" +print *, " run Run a binary of the local package (not implemented)" +print *, " test Run the tests (not implemented)" end subroutine subroutine run(cmd) @@ -174,4 +184,24 @@ call package_name(pkg_name) call run("gfortran main.o " // linking // " -o " // pkg_name) end subroutine +subroutine cmd_install() + print *, "fpm error: 'fpm install' not implemented." + error stop 1 +end subroutine + +subroutine cmd_new() + print *, "fpm error: 'fpm new' not implemented." + error stop 1 +end subroutine + +subroutine cmd_run() + print *, "fpm error: 'fpm run' not implemented." + error stop 1 +end subroutine + +subroutine cmd_test() + print *, "fpm error: 'fpm test' not implemented." + error stop 1 +end subroutine + end module fpm |