New feature for 1.26 (master), $(JUJU_HOME)/aliases

Wayne Witzel wayne.witzel at canonical.com
Mon Oct 26 14:51:46 UTC 2015


What is the advantage of this over using a standard alias in my shell
profile?

On Fri, Oct 23, 2015 at 11:05 AM, Aaron Bentley <aaron.bentley at canonical.com
> wrote:

> bzr has a similar feature, but the problem with such a feature is that
> it can break scripts that expect the normal behaviour.  That's why bzr
> provides a --no-aliases option, which all scripts calling bzr should use.
>
> The same applies to Juju.  If "status" gets defaulted to "status
> --format=tabular", most of our test scripts will break.  This isn't
> likely to happen on our test machines, but could easily happen when
> devs run our test scripts.
>
> Could you please provide a similar --no-aliases option for juju, so
> that we can ensure people don't break our scripts by specifying
> surprising defaults?
>
> Thanks,
>
> Aaron
>
> On 2015-10-23 12:12 AM, Tim Penhey 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
> >
> > 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.
> >
> > 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
>



-- 
Wayne Witzel III
wayne.witzel at canonical.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20151026/3efee4d2/attachment.html>


More information about the Juju-dev mailing list