extract_command cmd, argv

in lib/appengine/tasks.rb [176:198]


      def extract_command cmd, argv
        if cmd
          ::Shellwords.split cmd
        else
          i = (argv.index { |a| a.to_s == "--" } || -1) + 1
          if i.zero?
            report_error <<~MESSAGE
              No command provided for appengine:exec.
              Did you remember to delimit it with two dashes? e.g.
              bundle exec rake appengine:exec -- bundle exec ruby myscript.rb
              For detailed usage instructions, provide two dashes but no command:
              bundle exec rake appengine:exec --
            MESSAGE
          end
          command = ::ARGV[i..-1]
          if command.empty?
            show_usage
            exit
          end
          command
        end
      end