Method: Topicz::Commands::NoteCommand#option_parser

Defined in:
lib/topicz/commands/note_command.rb

#option_parserObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/topicz/commands/note_command.rb', line 20

def option_parser
  OptionParser.new do |options|
    options.banner = 'Usage: note <filter> [<title>]'
    options.on('-s', '--strict', 'Do a full strict match on topic IDs only') do
      @strict = true
    end
    options.separator ''
    options.separator 'Creates a new note for the specified topic.'
    options.separator ''
    options.separator 'The filter specifies the text to search on. The text is matched against the topic\'s: '
    options.separator '- path on the filesystem'
    options.separator '- id, if specified in the topic\'s topic.yaml file'
    options.separator '- title, if specified in the topic\'s topic.yaml file'
    options.separator '- aliases, if specified in the topic\'s topic.yaml file'
    options.separator ''
    options.separator 'The filter must return precisely one topic. Zero or more matches give an error.'
    options.separator ''
    options.separator 'The note title is optional. If omitted the title will be \'Unnamed note\'.'
  end
end