Method: QB::Role#usage
- Defined in:
- lib/qb/role.rb
#usage ⇒ String
Returns usage information formatted as plain text for the CLI.
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'lib/qb/role.rb', line 379 def usage # Split up options by required and optional. = [] = [] .each { |option| if option.required? << option else << option end } parts = ['qb [run]', name] .each { |option| parts << option.usage } unless .empty? parts << '[OPTIONS]' end if has_dir_arg? parts << 'DIRECTORY' end parts.join ' ' end |