Tuesday, 10 September 2013

Can I create an alias that has a param?

Can I create an alias that has a param?

I wish to shorten the typing of this:
rails g controller --skip-helper --skip-assets --skip-views
--skip-template-engine c6
where c6 is the controller name.
I'd like to be able to type railsgbc c6 # note: gbc=generate basic controller
I've tried:
$ alias railsgc='rails g controller --skip-helper --skip-assets
--skip-views --skip-template-engine'
but then when I try to use it I get:
$ railsgc play5
No value provided for required arguments 'name'
which is actually the same as if I type:
$ rails g controller --skip-helper --skip-assets --skip-views
--skip-template-engine c6
No value provided for required arguments 'name'
so it seems that I can't put the argument at the end, it needs to be right
after controller...

No comments:

Post a Comment