Skip to content

Commit dbf109f

Browse files
committed
Path prefix support
1 parent d92940f commit dbf109f

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

lib/cli.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,15 @@ def show_help
4242
puts 'description:'
4343
puts ' generates the source and header file'
4444
puts ' for the controller'
45+
puts 'parameters:'
46+
puts ' controller_name - the controller name cane be prefixed with a path'
47+
puts ' common prefixes are ddrace/, ball/, instagib/, vanilla/'
48+
puts ' they represent categories and are directories in the source code'
49+
puts ' parent_controller - controller to inherit from'
4550
puts 'examples:'
4651
puts ' ./scripts/cli zombie_party:base_pvp'
4752
puts ' ./scripts/cli my_new_mode:insta_core'
53+
puts ' ./scripts/cli ddrace/xxlddrace:insta_core'
4854
end
4955

5056
# Interactive menu to pick an item

lib/controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def initialize(opts = {})
3333
@filename = opts[:filename] || opts[:name]
3434
raise 'Filename can not be empty!' if @filename.nil? || @filename.empty?
3535
raise "Invalid filename: #{@filename}" if @filename.include? '.'
36+
@filename = @filename.split("/").first
3637

3738
@filename = @filename.to_snake
3839
end

0 commit comments

Comments
 (0)