lib/tdp/application.rb
# A list of all the standard options used in tdp, suitable for
# passing to OptionParser.
A list of all the standard options used in tdp, suitable for
passing to OptionParser.
A list of all the standard options used in tdp suitable for passing to OptionParser .
def standard_tdp_options
      [
        ['--no-search', '--nosearch', '-N', "Do not search parent directories for the TDPfile.",
          lambda { |value| options.nosearch = true }
        ],
        ['--tdpfile', '-f [FILE]', "Use FILE as the TDPfile.",
          lambda { |value|
            value ||= ''
            @tdp_files.clear
            @tdp_files << value
          }
        ],
        ['--tdplib', '-L [TDPLIBDIR]',
          "Auto-import any .tdp files in TDPLIBDIR. (default is 'tdplib')",
          lambda { |value| 
            value ||= 'tdplib'
            options.tdplib = value.split("#{File::PATH_SEPARATOR}")
          }
        ],
        ['--templates', '-T [TEMPLATESDIR]',
          "Lookup template files in TEMPLATESDIR. (default is 'templates'),
           overrides any path statements in the TDPfile",
          lambda { |value| 
            value ||= 'templates'
            add_template_path(files: value.split("#{File::PATH_SEPARATOR}"), freeze: true)
          }
        ],
        ['--trace', '-t', "Turn on invoke/execute tracing, enable full backtrace.",
          lambda { |value|
            options.trace = true
          }
        ],
        ['--version', '-V', "Display the program version.",
          lambda { |value|
            puts "tdp, version #{TDP::VERSION}"
            exit
          }
        ],
      ]
    end
def standard_tdp_options [ [ '--no-search' , '--nosearch' , '-N' , "Do not search parent directories for the TDPfile." , lambda { | value | options . nosearch = true } ] , [ '--tdpfile' , '-f [FILE]' , "Use FILE as the TDPfile." , lambda { | value | value ||= '' @tdp_files . clear @tdp_files << value } ] , [ '--tdplib' , '-L [TDPLIBDIR]' , "Auto-import any .tdp files in TDPLIBDIR. (default is 'tdplib')" , lambda { | value | value ||= 'tdplib' options . tdplib = value . split ( "#{File::PATH_SEPARATOR}" ) } ] , [ '--templates' , '-T [TEMPLATESDIR]' , "Lookup template files in TEMPLATESDIR. (default is 'templates'),
           overrides any path statements in the TDPfile" , lambda { | value | value ||= 'templates' add_template_path ( files : value . split ( "#{File::PATH_SEPARATOR}" ) , freeze : true ) } ] , [ '--trace' , '-t' , "Turn on invoke/execute tracing, enable full backtrace." , lambda { | value | options . trace = true } ] , [ '--version' , '-V' , "Display the program version." , lambda { | value | puts "tdp, version #{TDP::VERSION}" exit } ] , ] end
A list of all the standard options used in tdp, suitable for
passing to OptionParser.
A list of all the standard options used in tdp suitable for passing to OptionParser .
# freeze array to prevent additions from TDPfile