On 9/3/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote: > On 9/4/06, Philip Ganchev <[EMAIL PROTECTED]> wrote: > > On 9/3/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote: > > [...] > > > Separating function definition and listing into > > > two builtins is very unfortunate, it is a side effect from having the > > > 'function' builtin create a new block scope. 'set' and 'functions' > > > share a lot of behaviour, including many commandline switches. > > [...] > > > > Right, I know. So you could make `set` and `bind` also print help > > like `function` does, and make `set -a` and `bind -a` print list > > current definitions, like `functions` does. Wouldn't that make all > > three even more alike in syntax? > > Since the 'functions' builtin already prints all function definitions > when writing 'functions' alone, you would need to change that one as > well.
I guess so, yes. > To me, it feels natural that the default action for these functions is > to give you a bit of information on what's happening, and that you > should get help if you 'asked for it' either directly using a help > switch or indirectly by making a syntax error. 'function' prints the > usage message because you didn't specify a function name or close the > block, so you made two syntax errors. But what the default action of a > command should be is a matter of opinion. Different commands do > different things. I'm open to discussion on what is the best action, > but to me it seems that the current behaviour of e.g. 'set' is sane, > so you will have to change my opinion. Sure, there are advantages and drawbacks to doing it either way. The rationale for printing help when there are no arguments is that it is the most discoverable, because using `set -h` requires the user to know about the '-h' option. Another consideration is the size of the output. There are usually so many defined variables that they fill your screen. This is a problem because you lose sight of your previous output. On the other hand, most command line programs actually perform a task when given no arguments, so Fish builtins would be more consistent with those programs if they did so too. Then the builtins that begin a block would be inconsistent since `-h' does not work for them. ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
