lib/command_lion/flags.rb in command_lion-1.0.4 vs lib/command_lion/flags.rb in command_lion-2.0.0
- old
+ new
@@ -1,35 +1,11 @@
module CommandLion
- # The way a user is able to call or access a command or option for
- # a command-line application is by passing their flags when the application
- # is run at the command-line.
- #
- # == 🗣 DSL
- # The flags DSL works three different ways.
- #
- # == Index as Flag
- # app = CommandLion::Command.build do
- # command :hello do
- # # just use the index as the flag
- # end
- # end
- # == One Flag
- # app = CommandLion::Command.build do
- # command :hello do
- # flag "--hello"
- # end
- # end
- # == Short & Long Flags
- # app = CommandLion::Command.build do
- # command :hello do
- # flags do
- # short "-e"
- # long "--example"
- # end
- # end
- # end
class Flags < Base
simple_attrs :short, :long
- end
+
+ def all
+ [@short, @long].reject { |v| v.nil? }
+ end
+ end
end