From 832f4f059721903d0602dc8ff7bb068e1344a4b2 Mon Sep 17 00:00:00 2001 From: Lucy Davinhart Date: Mon, 11 Jun 2018 23:18:19 +0100 Subject: [PATCH] SetAliases for commands --- CHANGELOG.md | 1 + command.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c808f7..07eb3c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Actively catching terminal resize +- Add command aliases [0.3.0]: https://github.com/skybet/cali/compare/v0.2.0...v0.3.0 ## [0.3.0] - 2018-06-04 diff --git a/command.go b/command.go index 5571a05..195229e 100644 --- a/command.go +++ b/command.go @@ -24,6 +24,11 @@ func (c *Command) SetLong(l string) { c.cobra.Long = l } +// SetAliases sets aliases for a command +func (c *Command) SetAliases(a []string) { + c.cobra.Aliases = a +} + // setPreRun sets the cobra.Command.PreRun function func (c *Command) setPreRun(f cobraFunc) { c.cobra.PreRun = f