mirror of
				https://github.com/red-data-tools/YouPlot.git
				synced 2025-11-04 03:28:10 +08:00 
			
		
		
		
	Add count or c sub command.
This commit is contained in:
		@@ -39,6 +39,7 @@ module Uplot
 | 
			
		||||
      parsers['bar']         .on('-c', '--count', TrueClass) { |v| @count = v }
 | 
			
		||||
      parsers['barplot']     = parsers['bar']
 | 
			
		||||
      parsers['boxplot']     = parsers['box']
 | 
			
		||||
      parsers['count']       = parsers['c'] # barplot -c
 | 
			
		||||
      parsers.default        = nil
 | 
			
		||||
 | 
			
		||||
      main_parser.banner = <<~MSG
 | 
			
		||||
@@ -74,6 +75,9 @@ module Uplot
 | 
			
		||||
          barplot(data, headers)
 | 
			
		||||
        when 'box', 'boxplot'
 | 
			
		||||
          boxplot(data, headers)
 | 
			
		||||
        when 'count', 'c'
 | 
			
		||||
          @count = true
 | 
			
		||||
          barplot(data, headers)
 | 
			
		||||
        end.render($stderr)
 | 
			
		||||
 | 
			
		||||
        print input if @output
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user