-
-
Save ngw/cb9120d421b56894b5f159c84d08d747 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def parse_args(argv) do | |
parse = OptionParser.parse(argv, switches: [ help: :boolean, | |
from: :string , | |
to: :string], | |
aliases: [ h: :help, | |
f: :from, | |
t: :to ]) | |
case parse do | |
{ [ help: true ], _, _ } -> :help | |
{ [ to: to ], _, _ } -> [ from: '.' , to: to ] | |
{ [ from: from, to: to ], _, _ } -> [ from: from, to: to ] | |
_ -> :help | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment