<div dir="ltr"><div class="gmail_extra">You can accomplish most of this with the existing plugin system. You can't override existing commands, but you can easily create thin wrappers around them with your desired default args, and given the discussion around --no-aliases, it seems like this is actually a benefit. And plugins provide an easy way to add more intelligent handling of args, and also come with zero additional dev burden on core.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 27, 2015 at 3:24 AM, John Meinel <span dir="ltr"><<a href="mailto:john@arbash-meinel.com" target="_blank">john@arbash-meinel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The one thing I don't think bash aliases give you is proper handling of nested subcommands. Can you easily do "juju st" in a bash alias? or does it have to become "juju-st" ?<div>I think the caveats around people aliasing their way out of clumsiness in the tool is actually something to pay close attention to. It is very easy to customize a tool around making it work great the way you want, but the default experience for someone else is poor. (things like "juju status --format=tabular" is one of those key places where we need to think carefully about a great experience vs compatibility)</div><div><br></div><div>It *is* a way to prototype "what if the commands acted this way" for us, and to let users customize how they want to use the tool. But we need to be rather proactive about turning our findings into actual changes to the default behavior of the tool.</div><div><br></div><div>Thinking about "--no-aliases" actually runs into the problem that it isn't backwards compatible, either. You can't supply --no-aliases to old versions of Juju, and you have to supply it to new ones in scripts. It feels like ENV vars work a bit better here, as a script can set whatever ENV vars at the beginning and then leave the rest of the script alone. (I'm pretty sure that's why JUJU_CLI_VERSION=2 or whatever the exact syntax is, ended up as an ENV var.)</div><div><br></div><div>John</div><div>=:-></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 27, 2015 at 7:43 AM, Nate Finch <span dir="ltr"><<a href="mailto:nate.finch@canonical.com" target="_blank">nate.finch@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I don't think cross platform support of the config file format justifies the non-zero maintenance burden of the feature. Nor the non-zero maintenance burden of all the features that will inevitably follow after it, like the new --no-aliases flag, which is now cognitive overhead on every single command and every single script file.<br><br>Also, I think Rick has it right - aliases mean users end up with different experiences of the product. This happened to me all the time with bzr plugins - first Martin would have to figure out what plugins I was using and what format my repo was in, and then he could help me figure out what I'd screwed up. ;) And people using aliases often forget that the command they type all the time is not actually built into the product. I can't tell you how often I've had someone tell me to 'git co <something>' (which is a common - but not universal - alias for git checkout).<br><br>If you really want to use aliases, bash aliases work nearly identically, AFAICT, but with truly zero maintenance burden on core devs. By adding alias support to Juju, you're not only condoning aliases, you're encouraging their use, and I think that's a bad idea. If the UX of some of our commands suck, we should fix that. If our backwards compatibility policy is preventing us from fixing that, then at least we know the true cost of the policy - since most users in the wild are *not* going to be using any aliases. We should be using Juju in the same way as our less-experienced users, since all of our users will have to go through that period. (I'll ignore for the moment that quickstart has the exact same problem and is actually way more disruptive to the UX).<span><font color="#888888"><div><br></div><div>-Nate</div></font></span><div><div><div><br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 26, 2015 at 9:26 PM Tim Penhey <<a href="mailto:tim.penhey@canonical.com" target="_blank">tim.penhey@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Wayne,<br>
<br>
While I can see your point of view, I do disagree.<br>
<br>
While it may be of no benefit to you, it doesn't mean that others will<br>
not find it useful.<br>
<br>
I believe it is useful to have one format to specify aliases, one that<br>
doesn't depend on the shell that you use.<br>
<br>
The overhead in complexity isn't really that much, and with the<br>
--no-alias option which is coming, it still provides a way to ensure<br>
vanilla behaviour.<br>
<br>
<br>
Tim<br>
<br>
On 27/10/15 04:03, Wayne Witzel wrote:<br>
> After looking at this and the code more, I find myself very against this<br>
> feature. This adds code to core that is performing a tasks that most<br>
> people already know is handled by their shell. Even our Windows users<br>
> can install PowerShell and have aliases for commands. This adds no<br>
> benefit to core, it adds more complexity, and attempts to perform a task<br>
> that is already well handled by the users shell. If anything, this itch<br>
> could be scratched by adding some contrib documentation about some of<br>
> your favourite and/or most used aliases.<br>
><br>
> On Mon, Oct 26, 2015 at 10:51 AM, Wayne Witzel<br>
> <<a href="mailto:wayne.witzel@canonical.com" target="_blank">wayne.witzel@canonical.com</a> <mailto:<a href="mailto:wayne.witzel@canonical.com" target="_blank">wayne.witzel@canonical.com</a>>> wrote:<br>
><br>
> What is the advantage of this over using a standard alias in my<br>
> shell profile?<br>
><br>
> On Fri, Oct 23, 2015 at 11:05 AM, Aaron Bentley<br>
> <<a href="mailto:aaron.bentley@canonical.com" target="_blank">aaron.bentley@canonical.com</a> <mailto:<a href="mailto:aaron.bentley@canonical.com" target="_blank">aaron.bentley@canonical.com</a>>><br>
> wrote:<br>
><br>
> bzr has a similar feature, but the problem with such a feature<br>
> is that<br>
> it can break scripts that expect the normal behaviour. That's<br>
> why bzr<br>
> provides a --no-aliases option, which all scripts calling bzr<br>
> should use.<br>
><br>
> The same applies to Juju. If "status" gets defaulted to "status<br>
> --format=tabular", most of our test scripts will break. This isn't<br>
> likely to happen on our test machines, but could easily happen when<br>
> devs run our test scripts.<br>
><br>
> Could you please provide a similar --no-aliases option for juju, so<br>
> that we can ensure people don't break our scripts by specifying<br>
> surprising defaults?<br>
><br>
> Thanks,<br>
><br>
> Aaron<br>
><br>
> On 2015-10-23 12:12 AM, Tim Penhey wrote:<br>
> > Hi folks,<br>
> ><br>
> > I scratched a personal itch yesterday and added the ability for<br>
> > users to specify their own aliases for juju commands.<br>
> ><br>
> > There are two primary use cases that I was trying to address.<br>
> ><br>
> > Firstly, the ability to specify default flags for commands: status<br>
> > = status --format=tabular<br>
> ><br>
> > I could never remember the right environment variable to set to<br>
> > get tabular by default.<br>
> ><br>
> > The second was to allow quicker iteration around playing with new<br>
> > CLI structure. As most people are aware, the 2.0 CLI is going to<br>
> > be somewhat different to the current one, and I thought it<br>
> would be<br>
> > good to provide a way in which we could "test drive" the new CLI<br>
> > with the existing codebase without having to actually code<br>
> > anything.<br>
> ><br>
> > The aliases files lives in JUJU_HOME, and is a simple text file.<br>
> > Each non blank line that doesn't start with a '#' is considered to<br>
> > be an alias. The format is expected to be:<br>
> ><br>
> > <command> = <command> [<args>...]<br>
> ><br>
> > So we can do things like:<br>
> ><br>
> > # stat is like two whole letters shorter... stat = status<br>
> > --format=tabular<br>
> ><br>
> > # list tests list-environments = system environments list-users =<br>
> > user list<br>
> ><br>
> > and so on.<br>
> ><br>
> > Tim<br>
> ><br>
><br>
> --<br>
> Juju-dev mailing list<br>
> <a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a> <mailto:<a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a>><br>
> Modify settings or unsubscribe at:<br>
> <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Wayne Witzel III<br>
> <a href="mailto:wayne.witzel@canonical.com" target="_blank">wayne.witzel@canonical.com</a> <mailto:<a href="mailto:wayne.witzel@canonical.com" target="_blank">wayne.witzel@canonical.com</a>><br>
><br>
><br>
><br>
><br>
> --<br>
> Wayne Witzel III<br>
> <a href="mailto:wayne.witzel@canonical.com" target="_blank">wayne.witzel@canonical.com</a> <mailto:<a href="mailto:wayne.witzel@canonical.com" target="_blank">wayne.witzel@canonical.com</a>><br>
><br>
><br>
<br>
<br>
--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
</blockquote></div></div></div></div>
<br>--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com" target="_blank">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
<br></blockquote></div><br></div>
</div></div><br>--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
<br></blockquote></div><br></div></div>