{"record":{"id":"ae9117eff7a227af","repo":"jordansissel/fpm","slug":"all-flags-should-be-before-the-first-argument-str","errorCode":null,"errorMessage":"All flags should be before the first argument (stray flags found: #{stray_flags}","messagePattern":"All flags should be before the first argument \\(stray flags found: #(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/fpm/command.rb","lineNumber":291,"sourceCode":"    @conflicts = []\n    @replaces = []\n    @provides = []\n    @dependencies = []\n    @config_files = []\n    @directories = []\n  end # def initialize\n\n  # Execute this command. See Clamp::Command#execute and Clamp's documentation\n  def execute\n    logger.level = :warn\n    logger.level = :info if verbose? # --verbose\n    logger.level = :debug if debug? # --debug\n    if log_level\n      logger.level = log_level.to_sym\n    end\n\n    if (stray_flags = args.grep(/^-/); stray_flags.any?)\n      logger.warn(\"All flags should be before the first argument \" \\\n                   \"(stray flags found: #{stray_flags}\")\n    end\n\n    # Some older behavior, if you specify:\n    #   'fpm -s dir -t ... -C somepath'\n    # fpm would assume you meant to add '.' to the end of the commandline.\n    # Let's hack that. https://github.com/jordansissel/fpm/issues/187\n    if input_type == \"dir\" and args.empty? and !chdir.nil?\n      logger.info(\"No args, but -s dir and -C are given, assuming '.' as input\")\n      args << \".\"\n    end\n\n    if !File.exist?(workdir)\n      logger.fatal(\"Given --workdir=#{workdir} is not a path that exists.\")\n      raise FPM::Package::InvalidArgument, \"The given workdir '#{workdir}' does not exist.\"\n    end\n    if !File.directory?(workdir)\n      logger.fatal(\"Given --workdir=#{workdir} must be a directory\")","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/command.rb#L273-L309","documentation":"Error \"All flags should be before the first argument (stray flags found: #{stray_flags}\" thrown in jordansissel/fpm.","triggerScenarios":"Thrown at lib/fpm/command.rb:291 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}