Skip to content

Commit

Permalink
Merge pull request #131 from brianmorton/master
Browse files Browse the repository at this point in the history
✨Add version to search output
  • Loading branch information
phatblat authored Feb 13, 2018
2 parents 7165084 + 7f16909 commit 5011393
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Added the version number to search output

## [v1.3.1] Better Errors - 2016-09-25
- Descriptive error messages instead of exit codes
Expand Down
4 changes: 3 additions & 1 deletion mas-cli/Commands/Search.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ struct ResultKeys {
static let Results = "results"
static let TrackName = "trackName"
static let TrackId = "trackId"
static let Version = "version"
}

struct SearchCommand: CommandProtocol {
Expand All @@ -33,8 +34,9 @@ struct SearchCommand: CommandProtocol {

for result in results {
if let appName = result[ResultKeys.TrackName] as? String,
let appVersion = result[ResultKeys.Version] as? String,
let appId = result[ResultKeys.TrackId] as? Int {
print("\(String(appId)) \(appName)")
print("\(String(appId)) \(appName) (\(appVersion))")
}
}

Expand Down

0 comments on commit 5011393

Please sign in to comment.