Compare commits
No commits in common. "093c9d2fa1f193b51983165a4901343a0f9ff4d9" and "26510531e787645047ad6ca9de10a8c5724f94bd" have entirely different histories.
093c9d2fa1
...
26510531e7
6 changed files with 1 additions and 63 deletions
|
@ -1,17 +0,0 @@
|
||||||
require "./abstract_command"
|
|
||||||
|
|
||||||
module GX::Commands
|
|
||||||
class CompletionAutodetect < AbstractCommand
|
|
||||||
def initialize(@config : GX::Config)
|
|
||||||
end
|
|
||||||
|
|
||||||
def execute
|
|
||||||
STDERR.puts "FIXME: Completion auto-detection isn't implemented yet. Please select one of the following: --bash or --zsh"
|
|
||||||
exit(0)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.handles_mode
|
|
||||||
GX::Types::Mode::CompletionAutodetect
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,17 +0,0 @@
|
||||||
require "./abstract_command"
|
|
||||||
|
|
||||||
module GX::Commands
|
|
||||||
class CompletionBash < AbstractCommand
|
|
||||||
def initialize(@config : GX::Config)
|
|
||||||
end
|
|
||||||
|
|
||||||
def execute
|
|
||||||
completion_bash = FileStorage.get("completion.bash")
|
|
||||||
STDOUT.puts completion_bash.gets_to_end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.handles_mode
|
|
||||||
GX::Types::Mode::CompletionBash
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,17 +0,0 @@
|
||||||
require "./abstract_command"
|
|
||||||
|
|
||||||
module GX::Commands
|
|
||||||
class CompletionZsh < AbstractCommand
|
|
||||||
def initialize(@config : GX::Config)
|
|
||||||
end
|
|
||||||
|
|
||||||
def execute
|
|
||||||
completion_bash = FileStorage.get("completion.zsh")
|
|
||||||
STDOUT.puts completion_bash.gets_to_end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.handles_mode
|
|
||||||
GX::Types::Mode::CompletionZsh
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -4,7 +4,6 @@ module GX::Parsers
|
||||||
class CompletionParser < AbstractParser
|
class CompletionParser < AbstractParser
|
||||||
def build(parser, ancestors, config)
|
def build(parser, ancestors, config)
|
||||||
breadcrumbs = ancestors + "completion"
|
breadcrumbs = ancestors + "completion"
|
||||||
# config.mode = Types::Mode::CompletionAutodetect
|
|
||||||
|
|
||||||
parser.banner = Utils.usage_line(
|
parser.banner = Utils.usage_line(
|
||||||
breadcrumbs,
|
breadcrumbs,
|
||||||
|
@ -14,12 +13,10 @@ module GX::Parsers
|
||||||
parser.separator("\nCompletion commands:")
|
parser.separator("\nCompletion commands:")
|
||||||
|
|
||||||
parser.on("--bash", "Generate bash completion") do |_|
|
parser.on("--bash", "Generate bash completion") do |_|
|
||||||
config.mode = Types::Mode::CompletionBash
|
|
||||||
Log.info { "Set bash completion" }
|
Log.info { "Set bash completion" }
|
||||||
end
|
end
|
||||||
|
|
||||||
parser.on("--zsh", "Generate zsh completion") do |_|
|
parser.on("--zsh", "Generate zsh completion") do |_|
|
||||||
config.mode = Types::Mode::CompletionZsh
|
|
||||||
Log.info { "Set zsh completion" }
|
Log.info { "Set zsh completion" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -69,10 +69,7 @@ module GX::Parsers
|
||||||
# end
|
# end
|
||||||
|
|
||||||
parser.on("completion", "Manage completion") do
|
parser.on("completion", "Manage completion") do
|
||||||
config.mode = Types::Mode::GlobalHelp
|
config.mode = Types::Mode::GlobalCompletion
|
||||||
config.help_options = Parsers::Options::HelpOptions.new
|
|
||||||
config.help_options.try(&.parser_snapshot=(parser.dup))
|
|
||||||
|
|
||||||
Parsers::CompletionParser.new.build(parser, breadcrumbs, config)
|
Parsers::CompletionParser.new.build(parser, breadcrumbs, config)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
# mfm Zsh completion script
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue