Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6915087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:25:50+00:00 2026-05-27T09:25:50+00:00

Is it possible to pass multiple cmdline args to a Cakefile and capture those

  • 0

Is it possible to pass multiple cmdline args to a Cakefile and capture those values in an array? For example something like this:

option '', '--compilation-level [LEVEL]', 'Description...'
task "build", "compile js", (options)->
    compilationLevels = options['compilation-level'] || ['DEFAULT']
    if compilationLevels.length >= 2
        console.log 'multiple compiles'
    else
        console.log 'just one compile'

Then run it w/ cake --compilation-level ADVANCED_OPTIMIZATIONS --compilation-level SIMPLE_OPTIMIZATIONS build

If this is not possible then suggestions on the most optimal way to accomplish this would be greatly appreciated 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:25:51+00:00Added an answer on May 27, 2026 at 9:25 am

    Yep: Cake is powered by CoffeeScript’s OptionParser, which is ported from the Ruby utility of the same name. If you search the source for isList, you’ll see that an option can be used multiple times to create an array if (and only if) the regex

    OPTIONAL   = /\[(\w+(\*?))\]/
    

    is fully matched by the long flag name. In short: You just have to add one character to your code.

    option '', '--compilation-level [LEVEL*]', 'Description...'
    

    That * makes all the difference! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicates: SQL Multiple Parameter Values SQL Server (2008) Pass ArrayList or String to
Is it possible to have multiple has_many :through relationships that pass through each other
Possible Duplicate: Multiple arguments to function called by pthread_create()? How to pass more than
I know this is not possible, but is there something that would work? Basically
Possible Duplicate: PHP function with unlimited number of parameters How to pass array as
Is this possible in Excel? I have a workbook with multiple worksheets. I wrote
Is it possible to pass variables between multiple calls to the around MethodModier ?
Is it possible to initiate a timer and pass the selector method with multiple
I'm setting up a data model in django using multiple-table inheritance (MTI) like this:
Possible Duplicate: Pass a PHP string to a Javascript variable (and escape newlines) I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.