Skip to content

Commit

Permalink
More CLI options for debugging
Browse files Browse the repository at this point in the history
Add --debug-sources and --debug-relaton.  Disable them by default.
  • Loading branch information
skalee committed Mar 17, 2021
1 parent 0bcc873 commit b07e79e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions lib/iev/termbase/cli/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ def self.shared_option(name, methods:, **kwargs)
default: false,
methods: %i[xlsx2yaml db2yaml]

shared_option :debug_sources,
desc: "...",
type: :boolean,
default: false,
methods: %i[xlsx2yaml db2yaml]

shared_option :debug_relaton,
desc: "...",
type: :boolean,
default: false,
methods: %i[xlsx2yaml db2yaml]

shared_option :profile,
desc: "Generates profiler reports for this program, requires ruby-prof",
type: :boolean,
Expand Down
2 changes: 1 addition & 1 deletion lib/iev/termbase/relaton_db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def capture_output_streams
ensure
$stdout = original_stdout
$stderr = original_stderr
warn(fake_out.string) if fake_out.pos > 0
debug(:relaton, fake_out.string) if fake_out.pos > 0
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/iev/termbase/source_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def extract_source_ref(str)
/Constitution de l’Union internationale des télécommunications (UIT)/
"International Telecommunication Union (ITU) Constitution (Ed. 2015)"
else
warn "Failed to parse source: '#{str}'"
debug :sources, "Failed to parse source: '#{str}'"
str
end

Expand Down

0 comments on commit b07e79e

Please sign in to comment.