[Groonga-commit] groonga/groonga-command-parser at b31566b [master] groonga-command-convert-format: add --pretty-print option

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Jan 6 16:28:04 JST 2017


Kouhei Sutou	2017-01-06 16:28:04 +0900 (Fri, 06 Jan 2017)

  New Revision: b31566b291d4eea0afb6a15b6158646e86da7d73
  https://github.com/groonga/groonga-command-parser/commit/b31566b291d4eea0afb6a15b6158646e86da7d73

  Message:
    groonga-command-convert-format: add --pretty-print option

  Modified files:
    lib/groonga/command/parser/command/groonga-command-convert-format.rb

  Modified: lib/groonga/command/parser/command/groonga-command-convert-format.rb (+10 -2)
===================================================================
--- lib/groonga/command/parser/command/groonga-command-convert-format.rb    2016-12-20 15:34:06 +0900 (6c88299)
+++ lib/groonga/command/parser/command/groonga-command-convert-format.rb    2017-01-06 16:28:04 +0900 (1985d37)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014  Kouhei Sutou <kou �� clear-code.com>
+# Copyright (C) 2014-2017  Kouhei Sutou <kou �� clear-code.com>
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -26,6 +26,7 @@ module Groonga
           def initialize
             @format = :command
             @uri_prefix = "http://localhost:10041"
+            @pretty_print = true
           end
 
           def run(argv=ARGV)
@@ -70,6 +71,13 @@ module Groonga
               @uri_prefix = prefix
             end
 
+            option_parser.on("--[no-]pretty-print",
+                             "Pretty print",
+                             "Available only in command format",
+                             "[#{@pretty_print}]") do |boolean|
+              @pretty_print = boolean
+            end
+
             option_parser.parse!(argv)
           end
 
@@ -88,7 +96,7 @@ module Groonga
             when :uri
               "#{@uri_prefix}#{command.to_uri_format}"
             else
-              command.to_command_format
+              command.to_command_format(:pretty_print => @pretty_print)
             end
           end
         end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index