fpm_command_line Module

Definition of the command line interface

This module uses M_CLI2 to define the command line interface. To define a command line interface create a new command settings type from the fpm_cmd_settings base class or the respective parent command settings.

The subcommand is selected by the first non-option argument in the command line. In the subcase block the actual command line is defined and transferred to an instance of the fpm_cmd_settings, the actual type is used by the fpm main program to determine which command entry point is chosen.

To add a new subcommand add a new case to select construct and specify the wanted command line and the expected default values. Some of the following points also apply if you add a new option or argument to an existing fpm subcommand. At this point you should create a help page for the new command in a simple catman-like format as well in the set_help procedure. Make sure to register new subcommands in the fpm-manual command by adding them to the manual character array and in the help/manual case as well. You should add the new command to the synopsis section of the fpm-list, fpm-help and fpm --list help pages below to make sure the help output is complete and consistent as well.



Derived Types

type, public, extends(fpm_cmd_settings) ::  fpm_build_settings

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: archiver
logical, public :: build_tests = .false.
character(len=:), public, allocatable :: c_compiler
character(len=:), public, allocatable :: cflag
character(len=:), public, allocatable :: compiler
character(len=:), public, allocatable :: cxx_compiler
character(len=:), public, allocatable :: cxxflag
character(len=:), public, allocatable :: dump
character(len=:), public, allocatable :: flag
character(len=:), public, allocatable :: ldflag
logical, public :: list = .false.
character(len=:), public, allocatable :: profile
logical, public :: prune = .true.
logical, public :: show_model = .false.
logical, public :: verbose = .true.
character(len=:), public, allocatable :: working_dir

type, public, extends(fpm_cmd_settings) ::  fpm_clean_settings

Components

Type Visibility Attributes Name Initial
logical, public :: clean_all = .false.
logical, public :: clean_skip = .false.
logical, public :: registry_cache = .false.
logical, public :: verbose = .true.
character(len=:), public, allocatable :: working_dir

type, public, abstract ::  fpm_cmd_settings

Components

Type Visibility Attributes Name Initial
logical, public :: verbose = .true.
character(len=:), public, allocatable :: working_dir

type, public, extends(fpm_build_settings) ::  fpm_export_settings

Settings for exporting model data

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: archiver
logical, public :: build_tests = .false.
character(len=:), public, allocatable :: c_compiler
character(len=:), public, allocatable :: cflag
character(len=:), public, allocatable :: compiler
character(len=:), public, allocatable :: cxx_compiler
character(len=:), public, allocatable :: cxxflag
character(len=:), public, allocatable :: dump
character(len=:), public, allocatable :: dump_dependencies
character(len=:), public, allocatable :: dump_manifest
character(len=:), public, allocatable :: dump_model
character(len=:), public, allocatable :: flag
character(len=:), public, allocatable :: ldflag
logical, public :: list = .false.
character(len=:), public, allocatable :: profile
logical, public :: prune = .true.
logical, public :: show_model = .false.
logical, public :: verbose = .true.
character(len=:), public, allocatable :: working_dir

type, public, extends(fpm_build_settings) ::  fpm_install_settings

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: archiver
character(len=:), public, allocatable :: bindir
logical, public :: build_tests = .false.
character(len=:), public, allocatable :: c_compiler
character(len=:), public, allocatable :: cflag
character(len=:), public, allocatable :: compiler
character(len=:), public, allocatable :: cxx_compiler
character(len=:), public, allocatable :: cxxflag
character(len=:), public, allocatable :: dump
character(len=:), public, allocatable :: flag
character(len=:), public, allocatable :: includedir
character(len=:), public, allocatable :: ldflag
character(len=:), public, allocatable :: libdir
logical, public :: list = .false.
logical, public :: no_rebuild
character(len=:), public, allocatable :: prefix
character(len=:), public, allocatable :: profile
logical, public :: prune = .true.
logical, public :: show_model = .false.
character(len=:), public, allocatable :: testdir
logical, public :: verbose = .true.
character(len=:), public, allocatable :: working_dir

type, public, extends(fpm_cmd_settings) ::  fpm_new_settings

Components

Type Visibility Attributes Name Initial
logical, public :: backfill = .true.
character(len=:), public, allocatable :: name
logical, public :: verbose = .true.
logical, public :: with_bare = .false.
logical, public :: with_example = .false.
logical, public :: with_executable = .false.
logical, public :: with_full = .false.
logical, public :: with_lib = .true.
logical, public :: with_test = .false.
character(len=:), public, allocatable :: working_dir

type, public, extends(fpm_build_settings) ::  fpm_publish_settings

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: archiver
logical, public :: build_tests = .false.
character(len=:), public, allocatable :: c_compiler
character(len=:), public, allocatable :: cflag
character(len=:), public, allocatable :: compiler
character(len=:), public, allocatable :: cxx_compiler
character(len=:), public, allocatable :: cxxflag
character(len=:), public, allocatable :: dump
character(len=:), public, allocatable :: flag
logical, public :: is_dry_run = .false.
character(len=:), public, allocatable :: ldflag
logical, public :: list = .false.
character(len=:), public, allocatable :: profile
logical, public :: prune = .true.
logical, public :: show_model = .false.
logical, public :: show_package_version = .false.
logical, public :: show_upload_data = .false.
character(len=:), public, allocatable :: token
logical, public :: verbose = .true.
character(len=:), public, allocatable :: working_dir

type, public, extends(fpm_build_settings) ::  fpm_run_settings

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: archiver
character(len=:), public, allocatable :: args
logical, public :: build_tests = .false.
character(len=:), public, allocatable :: c_compiler
character(len=:), public, allocatable :: cflag
character(len=:), public, allocatable :: compiler
character(len=:), public, allocatable :: cxx_compiler
character(len=:), public, allocatable :: cxxflag
character(len=:), public, allocatable :: dump
logical, public :: example
character(len=:), public, allocatable :: flag
character(len=:), public, allocatable :: ldflag
logical, public :: list = .false.
character(len=ibug), public, allocatable :: name(:)
character(len=:), public, allocatable :: profile
logical, public :: prune = .true.
character(len=:), public, allocatable :: runner
character(len=:), public, allocatable :: runner_args
logical, public :: show_model = .false.
logical, public :: verbose = .true.
character(len=:), public, allocatable :: working_dir

Type-Bound Procedures

procedure, public :: name_ID
procedure, public :: runner_command

type, public, extends(fpm_run_settings) ::  fpm_test_settings

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: archiver
character(len=:), public, allocatable :: args
logical, public :: build_tests = .false.
character(len=:), public, allocatable :: c_compiler
character(len=:), public, allocatable :: cflag
character(len=:), public, allocatable :: compiler
character(len=:), public, allocatable :: cxx_compiler
character(len=:), public, allocatable :: cxxflag
character(len=:), public, allocatable :: dump
logical, public :: example
character(len=:), public, allocatable :: flag
character(len=:), public, allocatable :: ldflag
logical, public :: list = .false.
character(len=ibug), public, allocatable :: name(:)
character(len=:), public, allocatable :: profile
logical, public :: prune = .true.
character(len=:), public, allocatable :: runner
character(len=:), public, allocatable :: runner_args
logical, public :: show_model = .false.
logical, public :: verbose = .true.
character(len=:), public, allocatable :: working_dir

Type-Bound Procedures

procedure, public :: name_ID
procedure, public :: runner_command

type, public, extends(fpm_cmd_settings) ::  fpm_update_settings

Settings for interacting and updating with project dependencies

Components

Type Visibility Attributes Name Initial
logical, public :: clean
character(len=:), public, allocatable :: dump
logical, public :: fetch_only
character(len=ibug), public, allocatable :: name(:)
logical, public :: verbose = .true.
character(len=:), public, allocatable :: working_dir

Functions

public function get_fpm_env(env, default) result(val)

Get an environment variable for fpm, this routine ensures that every variable used by fpm is prefixed with FPM_.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: env
character(len=*), intent(in) :: default

Return Value character(len=:), allocatable


Subroutines

public subroutine get_command_line_settings(cmd_settings)

! canon_path is not converting “.”, etc. & ‘ unknown help topic “’//trim(unnamed(i)).’not found in:’,manual]

Arguments

Type IntentOptional Attributes Name
class(fpm_cmd_settings), intent(out), allocatable :: cmd_settings