GithubHelp home page GithubHelp logo

Unable to use lists multiple times about slop HOT 5 CLOSED

simonc avatar simonc commented on May 26, 2024
Unable to use lists multiple times

from slop.

Comments (5)

leejarvis avatar leejarvis commented on May 26, 2024

What version of Slop are you using?

from slop.

simonc avatar simonc commented on May 26, 2024

The last one, 3.3.2

from slop.

simonc avatar simonc commented on May 26, 2024

I wrote the following test and ran it against the repository code base and it failed:

test "list called twice" do
  opts = Slop.new { on :list=, '', true, as: Array }
  args = %w(--list a --list b,c)
  opts.parse!(args)
  assert_equal %w(a b c), opts[:list]
end

from slop.

leejarvis avatar leejarvis commented on May 26, 2024

The wiki is pointed at version 2 of Slop. I haven't yet gotten around to updating it. Sorry for the missinformation but the syntax :option, 'Description', true was deprecated in version 3. Version 3 also doesn't append to the same lists, I can add this as a new feature, though. Also the syntax --friends foo bar wont work, they need to be a single argument separated by a delimiter (defaulting to a comma).

from slop.

simonc avatar simonc commented on May 26, 2024

Ok, thanks for your rapid answer. I'll use a callback block as workaround for now ;)

from slop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.