Skip to content

Instantly share code, notes, and snippets.

@maxpowa
Created June 28, 2016 21:10
Show Gist options
  • Save maxpowa/512cd4d995817ec50931f52f1e2d9e0e to your computer and use it in GitHub Desktop.
Save maxpowa/512cd4d995817ec50931f52f1e2d9e0e to your computer and use it in GitHub Desktop.
require "option_parser"
module Blerp
abstract class CommandFlag
@@flags = { } of Symbol => CommandFlag
def self.flags
@@flags
end
def initialize
# Add to the flags array once initialized
@@flags[self.name] = self
end
getter name : Symbol
getter key : String
getter description : String
def processor (parser, data)
# optional implementation
end
def preprocessor (parser, data)
# optional implementation
end
def postprocessor (parser, data)
# optional implementation
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment