module Rooibos::CLI
Entry point for the Rooibos command-line interface.
Rooibos provides a CLI for common development tasks. Rather than remembering incantations for each tool, use a single command.
This module dispatches to subcommands. It routes new to project scaffolding and run to application execution.
Use it via the rooibos executable.
Example
# From terminal: rooibos new my_app cd my_app rooibos run # Programmatic access: Rooibos::CLI.call(["new", "my_app"]) Rooibos::CLI.call(["run"])
Public Class Methods
Source
# File lib/rooibos/cli.rb, line 43 def self.call(argv) command_name = argv.shift case command_name when "--version", "-v" puts "Rooibos #{Rooibos::VERSION}" when "--help", "-h", nil puts usage else command = COMMANDS[command_name] if command command.call(argv) else warn "Unknown command: #{command_name}" warn usage exit(1) end end end
Entry point for the CLI.
- argv
-
Command-line arguments array.
Source
# File lib/rooibos/cli.rb, line 64 def self.usage <<~USAGE Usage: rooibos <command> [options] Commands: new <appname> Create a new Rooibos application run Run the application in the current directory Options: --version, -v Show version --help, -h Show this help USAGE end
Returns the main usage message.