Skip to content

Flag value left blank results in printing help for main instead of command #234

@manther

Description

@manther

In the following example if you call the command "init -n" and don't pass a value for "-n" GLI prints the main help for the entire application instead of printing the help for the command that was being called "init"

#!/usr/bin/env ruby
require 'gli'
require 'json'
include GLI::App

program_desc 'Describe your application here'

version Testit::VERSION

subcommand_option_handling :normal
arguments :strict

command :init do |c|
  c.flag :n,
         :type     => String,
         :desc     => 'Name',
         :required => true
  c.action do |_, _, _|
    puts "test"
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions