Class: Fcom
- Inherits:
-
Object
- Object
- Fcom
- Extended by:
- MemoWise
- Defined in:
- lib/fcom.rb,
lib/fcom.rb,
lib/fcom/version.rb
Overview
rubocop:disable Style/StaticClass
Defined Under Namespace
Modules: OptionsHelpers Classes: ConfigFileOptions, GitHelpers, Parser, Querier
Constant Summary collapse
- ROOT_PATH =
'.'
- VERSION =
'0.13.0'
Class Method Summary collapse
Class Method Details
.define_slop_options(options) ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/fcom.rb', line 51 def () git_helpers = Fcom::GitHelpers.new default_repo = .repo || git_helpers.repo || 'username/repo' .string('--repo', 'GitHub repo (in form `username/repo`)', default: default_repo) .integer('-d', '--days', 'number of days to search back') .bool( '-r', '--regex', 'interpret search string as a regular expression', default: false, ) .bool('-i', '--ignore-case', 'search case-insensitively', default: false) .string( '-p', '--path', 'path (directory or file) used to filter results', default: Fcom::ROOT_PATH, ) .string( '-a', '--author', 'author', ) .string( '--rg-options', 'additional options passed directly to `rg` (e.g. `--rg-options "--max-columns 1000"`)', default: '--max-columns=2000', ) .bool('--debug', 'print debugging info', default: false) .bool('--parse-mode', 'whether we are in parse mode', default: false, help: false) .bool('--development', 'use local `fcom` executable', default: false, help: false) end |
.warn_if_config_file_repo_option_missing ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/fcom.rb', line 40 def warn_if_config_file_repo_option_missing if .repo.blank? puts(<<~WARNING.rstrip.yellow) Warning: you have not specified a `repo` option in an `.fcom.yml` file. This will cause `fcom` to execute more slowly than necessary. WARNING puts('Execute `fcom --init` to create an `.fcom.yml` file.'.blue.bold) puts("See https://github.com/davidrunger/fcom/#readme for more info.\n\n") end end |