Allow lookups based on short identifiers

This change introduces the ability to specify identifiers for jobs,
allocs, evals and nodes on the command line with as little as one
character, provided that it uniquely identifies the resource. An error
with the possible results will be provided when the short identifier
has multiple results.
This commit is contained in:
Ivo Verberk
2015-12-11 14:18:44 +01:00
parent 4fd5036fef
commit 7ae975e1a2
2 changed files with 61 additions and 9 deletions

View File

@@ -132,7 +132,7 @@ func (c *NodeStatusCommand) Run(args []string) int {
var allocs []string
if !short {
// Query the node allocations
nodeAllocs, _, err := client.Nodes().Allocations(nodeID, nil)
nodeAllocs, _, err := client.Nodes().Allocations(node.ID, nil)
if err != nil {
c.Ui.Error(fmt.Sprintf("Error querying node allocations: %s", err))
return 1