ruby - How to pass command line arguments to a rake task -
I have a rake function that needs to include a value in multiple databases.
I want to pass this value from the command line, or from the other rack work in the rock work.
How can I do this?
The options and dependencies must be within the array:
namespace Talk: "It does a job" function: work, [: option,: foo ,: bar] = & gt; [: Environment] Do | T, Args | "Work", Args and Functions: Second, [: Option,: foo ,: bar] = & gt; [: Environment] Do | T, Args | "Other # {args}" Rack: Task ["Cheese: Work"]. Press AZ (Args [: Option], Args [: Foo], Args [: Bar]) # or Args # Rack: Rule: "Task [" thing: work "]. (* Args) End End Then
Rack thing: Work [1,2,3] => Work: {: option = & gt; "1" ,: foo = & gt; "2" ,: bar = & gt; "3"} Rake object: Second [1,2,3] = & gt; Second {: option = & gt; "1" ,: foo = & gt; "2" ,: bar = & gt; "3"} = & gt; Work: {: option = & gt; "1" ,: foo = & gt; "2" ,: bar = & gt; "3"} Note: Variable for
Twork. This work item is not very useful, as long as you do not know what you are doing.
Comments
Post a Comment