Class: Wikiwiki::CLI
- Inherits:
-
Object
- Object
- Wikiwiki::CLI
- Defined in:
- lib/wikiwiki/cli.rb,
lib/wikiwiki/cli/commands/auth.rb,
lib/wikiwiki/cli/commands/base.rb,
lib/wikiwiki/cli/formatter/json.rb,
lib/wikiwiki/cli/commands/page/get.rb,
lib/wikiwiki/cli/commands/page/put.rb,
lib/wikiwiki/cli/commands/page/list.rb,
lib/wikiwiki/cli/commands/page/show.rb,
lib/wikiwiki/cli/commands/page/delete.rb,
lib/wikiwiki/cli/commands/attachment/get.rb,
lib/wikiwiki/cli/commands/attachment/put.rb,
lib/wikiwiki/cli/commands/attachment/list.rb,
lib/wikiwiki/cli/commands/attachment/show.rb,
lib/wikiwiki/cli/commands/attachment/delete.rb
Overview
Command-line interface for Wikiwiki
Provides commands for managing wiki pages and attachments through the terminal. Supports authentication via API key or password, with configurable logging and output modes.
Defined Under Namespace
Instance Attribute Summary collapse
-
#err ⇒ Object
readonly
Returns the value of attribute err.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
Instance Method Summary collapse
-
#initialize(out: $stdout, err: $stderr) ⇒ CLI
constructor
Initialize the CLI with output streams.
-
#run(argv) ⇒ Integer
Run the CLI with given arguments.
Constructor Details
#initialize(out: $stdout, err: $stderr) ⇒ CLI
Initialize the CLI with output streams
16 17 18 19 20 |
# File 'lib/wikiwiki/cli.rb', line 16 def initialize(out: $stdout, err: $stderr) @out = out @err = err @dry_cli = Dry::CLI.new(Commands) end |
Instance Attribute Details
#err ⇒ Object (readonly)
Returns the value of attribute err.
36 37 38 |
# File 'lib/wikiwiki/cli.rb', line 36 def err @err end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
35 36 37 |
# File 'lib/wikiwiki/cli.rb', line 35 def out @out end |
Instance Method Details
#run(argv) ⇒ Integer
Run the CLI with given arguments
26 27 28 29 30 31 32 33 |
# File 'lib/wikiwiki/cli.rb', line 26 def run(argv) @debug = argv.include?("--debug") @dry_cli.call(arguments: argv, out: @out, err: @err) 0 rescue => e handle_error(e) 1 end |