{"record":{"id":"0683817211cd27a8","repo":"fluent/fluentd","slug":"missing-arguments","errorCode":null,"errorMessage":"Missing arguments","messagePattern":"Missing arguments","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/fluent/command/plugin_generator.rb","lineNumber":122,"sourceCode":"Generate a project skeleton for creating a Fluentd plugin\n\nArguments:\n\\ttype: #{SUPPORTED_TYPES.join(\",\")}\n\\tname: Your plugin name (fluent-plugin- prefix will be added to <name>)\n\nOptions:\nBANNER\n\n    @parser.on(\"--[no-]license=NAME\", \"Specify license name (default: Apache-2.0)\") do |v|\n      @license_name = v || \"no-license\"\n    end\n    @parser\n  end\n\n  def parse_options!\n    @parser.parse!(@argv)\n    unless @argv.size == 2\n      raise ArgumentError, \"Missing arguments\"\n    end\n    @type, @name = @argv\n  rescue => e\n    usage(\"#{e.class}:#{e.message}\")\n  end\n\n  def usage(message = \"\")\n    puts message\n    puts\n    puts @parser.help\n    exit(false)\n  end\n\n  def user_name\n    v = `git config --get user.name`.chomp\n    v.empty? ? \"TODO: Write your name\" : v\n  end\n","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/command/plugin_generator.rb#L104-L140","documentation":"Raised as ArgumentError by FluentPluginGenerator#parse_options!: after option parsing, the remaining argv must contain exactly two positional arguments (plugin type and plugin name). The rescue block prints the message plus the option banner and exits false, so the user sees usage instead of a stack trace.","triggerScenarios":"Running fluent-plugin-generator with no arguments, only one (fluent-plugin-generator output), or three or more; quoting mistakes that split or merge the two arguments.","commonSituations":"First-time use of the generator; wrapper scripts passing optional/empty arguments; forgetting that --license=NAME is an option, not a positional.","solutions":["Run fluent-plugin-generator <type> <name>, e.g. fluent-plugin-generator output my_plugin","Use one of the supported types: input, output, filter, parser, formatter, storage","Check fluent-plugin-generator --help for options like --[no-]license before the positional arguments"],"exampleFix":"# before\nfluent-plugin-generator output\n\n# after\nfluent-plugin-generator output my_plugin","handlingStrategy":"validation","validationCode":"usage = 'fluent-plugin-generator <type> <name>'\nabort usage unless ARGV.length == 2\nabort 'type must be input/output/filter/parser/formatter/storage' unless %w[input output filter parser formatter storage].include?(ARGV[0])","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the two positional arguments: plugin type then plugin name","Run fluent-plugin-generator --help when in doubt about options vs positionals","Wrap the generator in a script that validates arguments first"],"tags":["fluentd","plugin-generator","cli","usage-error"],"backgroundTag":"missing-cli-arguments","analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}