X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli/blobdiff_plain/1263f62c5c6379f11e19eb184ffedf5889390b70..4c5df35e2af0d6c048e9b366d50ef740cfe0a728:/Sources/arguments_source.swift?ds=inline diff --git a/Sources/arguments_source.swift b/Sources/arguments_source.swift index d1bf4c6..9615318 100644 --- a/Sources/arguments_source.swift +++ b/Sources/arguments_source.swift @@ -1,10 +1,13 @@ -/// Source that deals with command line +// Source that reads track artist and name from the command line class ArgumentsSource: Source { - public var currentTrack: Track? { - if CommandLine.arguments.count >= 3 { - // expected usage: $ ./lyricli + // Returns a track based on the arguments. It assumes the track artist + // will be the first argument, and the name will be the second, excluding + // any flags. + var currentTrack: Track? { + if CommandLine.arguments.count >= 3 { + // expected usage: $ ./lyricli let trackName: String = CommandLine.arguments[2] let trackArtist: String = CommandLine.arguments[1]