Octopus
help.F90
Go to the documentation of this file.
1!! Copyright (C) 2007 Xavier Andrade
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
21program oct_help
23 use global_oct_m
25
26 implicit none
27
28 integer :: ierr
29 character(len=32) :: mode
30 character(len=100) :: varname
31
32 integer, parameter :: help_stdout = 6, help_stderr = 0
33
35
36 call getopt_init(ierr)
37 if (ierr /= 0) then
38 write(stderr, '(a)') "Your Fortran compiler doesn't support command-line arguments;"
39 write(stderr, '(a)') "the oct-help command is not available."
40 stop
41 end if
42
43 mode = " "
44 varname = " "
45 call getopt_help(mode, varname)
46 call getopt_end()
47
48 select case (mode)
49 case ("print")
50 call varinfo_print(help_stdout, trim(varname), ierr)
51 if (ierr /= 0) then
52 write(help_stderr, '(a)') "Error: Variable "//trim(varname)//" not found."
53 end if
54
55 case ("search")
56 call varinfo_search(help_stdout, trim(varname), ierr)
57
58 case ("list")
59 call varinfo_search(help_stdout, "", ierr)
60 end select
61
62 call global_end()
63
64end program oct_help
65
66!! Local Variables:
67!! mode: f90
68!! coding: utf-8
69!! End:
program oct_help
Definition: help.F90:114
subroutine, public getopt_init(ierr)
Initializes the getopt machinery. Must be called before attempting to parse the options....
subroutine, public getopt_end
subroutine, public global_end()
Finalise parser varinfo file, and MPI.
Definition: global.F90:381
type(mpi_comm), parameter, public serial_dummy_comm
Alias MPI_COMM_UNDEFINED for the specific use case of initialising Octopus utilities with no MPI supp...
Definition: global.F90:264
subroutine, public init_octopus_globals(comm)
Initialise Octopus-specific global constants and files. This routine performs no initialisation calls...
Definition: global.F90:353
subroutine, public varinfo_print(iunit, var, ierr)
Definition: varinfo.F90:204
subroutine, public varinfo_search(iunit, var, ierr)
Definition: varinfo.F90:364