mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add -v argument to use document formatter
This commit is contained in:
parent
a3c4d06e45
commit
f338e9b99d
1 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
|||
require "option_parser"
|
||||
|
||||
module Spectator
|
||||
# Generates configuration from the command-line arguments.
|
||||
class CommandLineArgumentsConfigSource < ConfigSource
|
||||
|
@ -10,7 +12,9 @@ module Spectator
|
|||
# Applies the specified configuration to a builder.
|
||||
# Calling this method from multiple sources builds up the final configuration.
|
||||
def apply_to(builder : ConfigBuilder) : Nil
|
||||
# ...
|
||||
OptionParser.parse(@args) do |parser|
|
||||
parser.on("-v", "--verbose", "Verbose output using document formatter") { builder.formatter = Formatting::DocumentFormatter.new }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue