anchor.diff:      nargs = command_argument_count()
   
       if (nargs == 0) then
  -       ! no args: print syntax and stop
  -       write(0,*) trim(syntax)
  +       write(0,100)! no args: print syntax and stop
          error_code = 1
          return
       end if
  
positive.code:        select case(trim(arg))
         case('-h','--help')
            ! print help and exit
            write(0,*) trim(syntax)
            error_code = 1
            return
         case('-i','--int','--fasta')
  
negative.code:        
      end if
  
  100 format(&
           'elss-learn (elss v0.2.1)                                                       '/& 
           '                                                                               '/&
           'Usage:                                                                         '/&
           '    elss-learn [options] -i <data_file>                                        '/&
           '    elss-learn [options] --fasta <fasta_file>                                  '/&
           '    (preceded by mpiexec -n <n_proc> for parallel execution)                   '/&
           '                                                                               '/&
           'Description:                                                                   '/&
           '    Read a data matrix and fit a model of pairwise interacting categorical     '/&
           '    variables. Valid input formats are the FASTA format for biological multiple'/&
           '    sequence alignments, or plain space/tab separated values.                  '/&
           '    The fitted parameters are dumped in a `chk` file that can be an input to   '/&
           '    - elss-sample, to generate artificial samples according to the fitted model'/&
           '    - elss-eval, to measure the relative probability of new samples            '/&
           '      according to the model).                                                 '/&
           '                                                                               '/&
           'Required:                                                                      '/&
           '-i, --int <data_file>                                                          '/&
           '    Path to data file.                                                         '/&
           '                                                                               '/&
           '--fasta <data_file>                                                            '/&
           '    Path to FASTA multiple sequence alignment.                                 '/&
           '                                                                               '/&
           'Options:                                                                       '/&
           '-h, --help                                                                     '/&
           '    Display this help and exit.                                                '/&
           '                                                                               '/&
           '--prefix <str>                                                                 '/&         
           '    Prefix of output files.                                                    '/&
           '                                                                               '/&
           '-p, --prm <prm_file>                                                           '/&
           '    Read the initial guess for parameters from file <prm_file>.                '/&
           '                                                                               '/&
           '-c, --chk <chk_file>                                                           '/&
           '    Restart a previous calculation from checkpoint file <chk_file>             '/&
           '                                                                               '/&
           '-n, --nsweeps <n>, integer                                                     '/&
           '    Number of MC sweeps per gradient estimate.                                 '/&
           '    [default: 1000]                                                            '/&
           '                                                                               '/&
           '-u, --nupdate <n>, integer                                                     '/&
           '    During gradient estimate: update model averages every <n> sweeps.          '/&
           '    [default: 1000]                                                            '/&
           '                                                                               '/&
           '--wid <%id>, float                                                             '/&
           '    Compute data averages reweighting each sample according to its similarity  '/&
           '    to the rest of data, using a threshold <%id> to define data/sequence       '/&
           '    similarity.                                                                '/&
           '    [default: no reweighting]                                                  '/&
           '                                                                               '/&
           '-w, --weights <file>, path_to_file                                             '/&
           '    Read weights for data from file <file>.                                    '/&
           '                                                                               '/&
           '--learn, --learn-agd <n>, integer                                              '/&
           '    Number of accelerated gradient descent steps.                              '/&
           '    [default: 2000]                                                            '/&
           '                                                                               '/&
           '--learn, --learn-gd <n>, integer                                               '/&
           '    Number of gradient descent steps.                                          '/&
           '    [default: 0]                                                               '/&
           '                                                                               '/&
           '-l, --lambda <regularization_strength>, float                                  '/&
           '    Parameter controlling the strength of l2 regularization.                   '/&
           '    [default: 0.01]                                                            '/&
           '                                                                               '/&
           '--random_seed <seed>, integer                                                  '/&
           '    Seed for initialization of pseudo-random number generator.                 '/&
           '    If == 0, the seed is computed from the system clock.                       '/&
           '    [default: 0]                                                               '/)
  
    end subroutine command_line_read
  
  end module learn_command_line
  