Compare commits
No commits in common. "605df92b375020597825ec9c322726b28db91c2a" and "4db116121c3f5d4e786f6a9dd002a1e526847cfe" have entirely different histories.
605df92b37
...
4db116121c
6 changed files with 5 additions and 28 deletions
|
@ -68,8 +68,5 @@ func (c *addCommand) addAccountsToList(gtsClient *client.Client) error {
|
||||||
return fmt.Errorf("unable to add the accounts to the list; %w", err)
|
return fmt.Errorf("unable to add the accounts to the list; %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Successfully added the account(s) to the list.")
|
|
||||||
// TODO: ...then print the list with the accounts in them.
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,6 @@ func run() error {
|
||||||
updateResource string = "update"
|
updateResource string = "update"
|
||||||
whoami string = "whoami"
|
whoami string = "whoami"
|
||||||
add string = "add"
|
add string = "add"
|
||||||
remove string = "remove"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
summaries := map[string]string{
|
summaries := map[string]string{
|
||||||
|
@ -66,7 +65,6 @@ func run() error {
|
||||||
updateResource: "update a specific resource",
|
updateResource: "update a specific resource",
|
||||||
whoami: "print the account that you are currently logged in to",
|
whoami: "print the account that you are currently logged in to",
|
||||||
add: "add a resource to another resource",
|
add: "add a resource to another resource",
|
||||||
remove: "remove a resource from another resource",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
flag.Usage = enbasUsageFunc(summaries)
|
flag.Usage = enbasUsageFunc(summaries)
|
||||||
|
@ -103,8 +101,6 @@ func run() error {
|
||||||
executor = newWhoAmICommand(whoami, summaries[whoami])
|
executor = newWhoAmICommand(whoami, summaries[whoami])
|
||||||
case add:
|
case add:
|
||||||
executor = newAddCommand(add, summaries[add])
|
executor = newAddCommand(add, summaries[add])
|
||||||
case remove:
|
|
||||||
executor = newRemoveCommand(remove, summaries[remove])
|
|
||||||
default:
|
default:
|
||||||
flag.Usage()
|
flag.Usage()
|
||||||
return fmt.Errorf("unknown subcommand %q", subcommand)
|
return fmt.Errorf("unknown subcommand %q", subcommand)
|
||||||
|
|
|
@ -68,8 +68,5 @@ func (c *removeCommand) removeAccountsFromList(gtsClient *client.Client) error {
|
||||||
return fmt.Errorf("unable to remove the accounts from the list; %w", err)
|
return fmt.Errorf("unable to remove the accounts from the list; %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Successfully removed the account(s) to the list.")
|
|
||||||
// TODO: ...then print the list with the accounts in them.
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,10 @@ func (c *showCommand) showLists(gts *client.Client) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(utilities.HeaderFormat("LISTS"))
|
fmt.Println(utilities.HeaderFormat("LISTS"))
|
||||||
fmt.Println(lists)
|
|
||||||
|
for i := range lists {
|
||||||
|
fmt.Printf("\n%s\n", lists[i])
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ const (
|
||||||
listPath string = "/api/v1/lists"
|
listPath string = "/api/v1/lists"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (g *Client) GetAllLists() (model.Lists, error) {
|
func (g *Client) GetAllLists() ([]model.List, error) {
|
||||||
url := g.Authentication.Instance + listPath
|
url := g.Authentication.Instance + listPath
|
||||||
|
|
||||||
var lists []model.List
|
var lists []model.List
|
||||||
|
|
|
@ -87,19 +87,3 @@ func (l List) String() string {
|
||||||
utilities.FieldFormat("Replies Policy:"), l.RepliesPolicy,
|
utilities.FieldFormat("Replies Policy:"), l.RepliesPolicy,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
type Lists []List
|
|
||||||
|
|
||||||
func (l Lists) String() string {
|
|
||||||
output := ""
|
|
||||||
|
|
||||||
for i := range l {
|
|
||||||
output += fmt.Sprintf(
|
|
||||||
"\n%s (%s)",
|
|
||||||
l[i].Title,
|
|
||||||
l[i].ID,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return output
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue