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