jwaldrip / admiral.cr

A robust DSL for writing command line interfaces written in Crystal.
https://jwaldrip.github.com/admiral.cr
MIT License
135 stars 14 forks source link

IO might be Bool #6

Closed bararchy closed 6 years ago

bararchy commented 6 years ago
in macro 'define_version' admiral/src/admiral/command/version.cr:19, line 5:

   1.     
   2.       define_flag __version__ : Bool, long: version, short: nil
   3.       protected def __run__ : Nil
   4.         if flags.__version__
>  5.           puts version
   6.           exit
   7.         else
   8.           previous_def
   9.         end
  10.       end
  11.     
  12. 
  13.     def version
  14.       "0.0.1"
  15.     end
  16.   

instantiating 'puts(String)'
in lib/admiral/src/admiral/command.cr:79: undefined method 'puts' for Bool (compile-time type is (Bool | IO::FileDescriptor))

      io.puts(*args)
         ^~~~

================================================================================

Bool trace:

  lib/admiral/src/admiral/command.cr:77

        case (io = @output_io)
              ^~

  lib/admiral/src/admiral/command.cr:77

        case (io = @output_io)
                   ^~~~~~~~~~

  lib/admiral/src/admiral/command.cr:8

      @output_io : IO::FileDescriptor | Bool = STDOUT
      ^~~~~~~~~~
jwaldrip commented 6 years ago

@bararchy what version of crystal are you on?

bararchy commented 6 years ago

@jwaldrip 0.24.pre-1

jwaldrip commented 6 years ago

I need to wait until 0.24 is stable. Once it is, I will do an update. Sorry for the wait.

bararchy commented 6 years ago

All good , thank you for taking the time to move this project forward :)

JKJameson commented 6 years ago

I'm getting this error in stable with Archlinux.

Trying to compile gpd-fan.

jwaldrip commented 6 years ago

This should be fixed in the latest version. Can you confirm? On Mon, Jan 8, 2018 at 4:38 AM Josh Jameson notifications@github.com wrote:

I'm getting this error in stable with Archlinux.

Trying to compile gpd-fan.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/jwaldrip/admiral.cr/issues/6#issuecomment-355944329, or mute the thread https://github.com/notifications/unsubscribe-auth/AAConEfTDavH_4yLEpd6-n_yxfDJ1CX6ks5tIf4kgaJpZM4QHipr .