New feature for 1.26 (master), $(JUJU_HOME)/aliases
roger peppe
roger.peppe at canonical.com
Fri Oct 23 08:28:56 UTC 2015
On 23 October 2015 at 05:12, Tim Penhey <tim.penhey at canonical.com> wrote:
> Hi folks,
>
> I scratched a personal itch yesterday and added the ability for users to
> specify their own aliases for juju commands.
>
> There are two primary use cases that I was trying to address.
>
> Firstly, the ability to specify default flags for commands:
> status = status --format=tabular
This sounds useful, thanks. Presumably additional arguments are
just tacked onto the end?
> I could never remember the right environment variable to set to get
> tabular by default.
>
> The second was to allow quicker iteration around playing with new CLI
> structure. As most people are aware, the 2.0 CLI is going to be
> somewhat different to the current one, and I thought it would be good to
> provide a way in which we could "test drive" the new CLI with the
> existing codebase without having to actually code anything.
Unless the new CLI is non-hierarchical I'm thinking that may
not work unless you can specify multi-level aliases;
For example:
model destroy = environment destroy
which might be a little harder.
While I'm on the subject of hierarchical CLIs, I often have difficulty
remembering where a given command is buried. "juju commands | grep"
was often a decent solution but doesn't work when the command
I'm looking for is buried two levels deep. Any chance of something like
"juju commands --all" to show all commands, even those two or more
levels down?
cheers,
rog.
>
> The aliases files lives in JUJU_HOME, and is a simple text file. Each
> non blank line that doesn't start with a '#' is considered to be an
> alias. The format is expected to be:
>
> <command> = <command> [<args>...]
>
> So we can do things like:
>
> # stat is like two whole letters shorter...
> stat = status --format=tabular
>
> # list tests
> list-environments = system environments
> list-users = user list
>
> and so on.
>
> Tim
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
More information about the Juju-dev
mailing list