1 /// Source that deals with command line
2 class ArgumentsSource: Source {
3 public var currentTrack: Track? {
5 if CommandLine.arguments.count >= 3 {
7 // expected usage: $ ./lyricli <artist> <name>
9 let trackName: String = CommandLine.arguments[2]
10 let trackArtist: String = CommandLine.arguments[1]
12 return Track(withName: trackName, andArtist: trackArtist)