Packages
Syts is a very basic command-line YouTube searcher. It takes a query from the user, grabs (up to) 5 YouTube results, and then presents them to the user for selection. The selected video is then played in MPV. I wrote this to try out Elixir. It's probably not idiomatic or safe to use.
Current section
Files
Jump to
Current section
Files
lib/cli/cli.ex
defmodule Syts.CLI do
@moduledoc """
This is the `Syts.CLI` module.
`Syts.CLI` provides a (very) simple CLI interface to `Syts`.
"""
@doc """
Invoke `Syts.run/1` with a query string created out of the argument list provided.
"""
@spec main([String.t()]) :: :ok
def main(args) do
query = Enum.join args
case query do
"" ->
IO.puts "Usage: syts [query]"
System.halt 0
_ ->
Syts.run query
end
end
end