Skip to content

Commit

Permalink
Fixed typespec for input specs to handle subcommands
Browse files Browse the repository at this point in the history
Originally, subcommands was not one of the specified spec_items, which meant that any call to Optimus.new which had :subcommands specified would result in a `fun/n has no local return" type error
  • Loading branch information
Nate Heydt committed Nov 3, 2021
1 parent f61819d commit b79f26a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/optimus.ex
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ defmodule Optimus do
| {:args, [arg_spec_item]}
| {:flags, [flag_spec_item]}
| {:options, [option_spec_item]}
| {:subcommands, [{atom, spec}]}
@type spec :: [spec_item]

@type error :: String.t()
Expand Down

1 comment on commit b79f26a

@RooSoft
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

When could this fix get into a future release?

I'd update right away.

Please sign in to comment.