]> git.r.bdr.sh - rbdr/lyricli/blobdiff - Sources/arguments_source.swift
Merge branch 'release/0.2.0'
[rbdr/lyricli] / Sources / arguments_source.swift
index d1bf4c607a992e3ce91ad4357531ba965b7f5d8a..9615318d4037f63b000a8d6561648daa0a6075a9 100644 (file)
@@ -1,10 +1,13 @@
-/// Source that deals with command line
+// Source that reads track artist and name from the command line
 class ArgumentsSource: Source {
 class ArgumentsSource: Source {
-    public var currentTrack: Track? {
-        if CommandLine.arguments.count >= 3 {
 
 
-            // expected usage: $ ./lyricli <artist> <name>
+    // 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 <artist> <name>
             let trackName: String = CommandLine.arguments[2]
             let trackArtist: String = CommandLine.arguments[1]
 
             let trackName: String = CommandLine.arguments[2]
             let trackArtist: String = CommandLine.arguments[1]