Sha256: b349fb6c39fd886f301314ac456d8d8f225a0f290bd6a7046ab15ae484094fb8
Contents?: true
Size: 1.47 KB
Versions: 3
Compression:
Stored size: 1.47 KB
Contents
require 'markdo/add_command' require 'markdo/edit_command' require 'markdo/help_command' require 'markdo/overview_command' require 'markdo/query_command' require 'markdo/star_command' require 'markdo/tag_command' require 'markdo/today_command' require 'markdo/tomorrow_command' require 'markdo/version_command' module Markdo class CLI def initialize(stdout, stderr, full_env) @stdout = stdout @stderr = stderr @full_env = full_env end def run(command_name = 'help', *args) command = case command_name when 'add' AddCommand when 'edit' EditCommand when 'overdue' OverdueCommand when 'overview' OverviewCommand when 'query', 'q' QueryCommand when 'star', 'starred' StarCommand when 'tag' TagCommand when 'today' TodayCommand when 'tomorrow' TomorrowCommand when 'version', '--version' VersionCommand else HelpCommand end command.new(@stdout, @stderr, env).run(*args) end private def default_env { 'MARKDO_ROOT' => '.', 'MARKDO_INBOX' => 'Inbox.md', } end def env default_env.merge(@full_env) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
markdo-0.1.2 | lib/markdo/cli.rb |
markdo-0.1.1 | lib/markdo/cli.rb |
markdo-0.1.0 | lib/markdo/cli.rb |