Issue398

Title grml-x::missing switch `fallback' in completion & manpage
Priority bug Status chatting
Superseder Nosy List ft, mika, z3ttacht
Assigned To Topics grml-x, zsh

Created on 2008-02-06.09:10:53 by z3ttacht, last changed 2008-03-01.08:58:32 by ft.

Files
File name Uploaded Type Edit Remove
grml-x-1of2-dd65614ab2c7.diff ft, 2008-02-22.14:19:53 text/plain
grml-x-2of2-431dbba93cd0.diff ft, 2008-02-22.14:19:54 text/plain
grml-x_add-fallback.diff z3ttacht, 2008-02-06.09:10:51 text/x-diff
grml-x_double-brackets-typo_corr.diff z3ttacht, 2008-02-06.12:58:42 text/x-diff
grml-x_double-brackets.diff z3ttacht, 2008-02-06.09:10:51 text/x-diff
Messages
msg1233 (view) Author: ft Date: 2008-03-01.08:58:30
Michael Prokop <mika@grml.org>:
> * Alexander Steinböck <bts@bts.grml.org> [20080222 23:26]:
> > > '7' and '8' as the only completions for -display? Reason?
> 
> > Afaics the first six are used for tty{1..6}. (/etc/inittab.grml)
> > Maybe the author hasn't had any need for more than two displays so
> > far? But that's just guesses, since I'm not responsible for that
> > entry. (o;
> 
> Yeah, tty's 7 and 8 are known to be available for X on grml and I
> want to make sure grml-x is working OOTB as stable as possible.
> 
> If a user is aware of the fact that tty $NUMBER != [7|8] is
> available for X he can run grml-x the way he likes it to anyway.

This means, the patches I send earlier should do the right thing[tm]
and close this bug.

Regards, Frank
msg1219 (view) Author: ft Date: 2008-02-22.22:37:20
Alexander Steinböck <bts@bts.grml.org>:
> > '7' and '8' as the only completions for -display? Reason?
> Afaics the first six are used for tty{1..6}. (/etc/inittab.grml)
> Maybe the author hasn't had any need for more than two displays so
> far? But that's just guesses, since I'm not responsible for that
> entry. (o;

...I'm almost far enough to check the grml-x code myself. :-)
I thought of $DISPLAY, the tty on the other hand would make sense.

> > > > However, I tend to agree with you. Leave check_com() out.
> > Just for the record:
> >   check_com() is available outside of our zshrc now.
> Great. But as discussed earlier, we still do agree to not use it here,
> don't we?

Yeah, hence I said JFTR. :-)

Regards, Frank
msg1218 (view) Author: mika Date: 2008-02-22.22:31:30
* Alexander Steinböck <bts@bts.grml.org> [20080222 23:26]:

> > '7' and '8' as the only completions for -display? Reason?

> Afaics the first six are used for tty{1..6}. (/etc/inittab.grml)
> Maybe the author hasn't had any need for more than two displays so
> far? But that's just guesses, since I'm not responsible for that
> entry. (o;

Yeah, tty's 7 and 8 are known to be available for X on grml and I
want to make sure grml-x is working OOTB as stable as possible.

If a user is aware of the fact that tty $NUMBER != [7|8] is
available for X he can run grml-x the way he likes it to anyway.

JFYI && regards,
-mika-
msg1217 (view) Author: z3ttacht Date: 2008-02-22.22:26:07
* Frank Terbeck <bts@bts.grml.org> [2008-02-22 15:20]:
> However, I think your fix is not the best solution, we can provide. I
> am attaching two exports. Please review. I *think* they are ready for
> inclusion.
Your extensions are really sophisticated. I'm all for them. Didn't
even think to extend the other switches. Have been just fixated on the
'bug' concerning `-help'. (o;

> '7' and '8' as the only completions for -display? Reason?
Afaics the first six are used for tty{1..6}. (/etc/inittab.grml)
Maybe the author hasn't had any need for more than two displays so
far? But that's just guesses, since I'm not responsible for that
entry. (o;

> > > However, I tend to agree with you. Leave check_com() out.
> Just for the record:
>   check_com() is available outside of our zshrc now.
Great. But as discussed earlier, we still do agree to not use it here,
don't we?
msg1214 (view) Author: ft Date: 2008-02-22.14:19:54
Alexander Steinböck <bts@bts.grml.org>:
> Alexander Steinböck <z3ttacht@grml.org> added the comment:
> * Frank Terbeck <bts@bts.grml.org> [2008-02-06 12:25]:
> > > And `help' is completing with brackets attached.
> > > Culprit's the leading colon.
> > Um, I just tried the completion. What is your problem with the way it
> > currently works? I don't see any 'brackets attached'.
> When completing, I get
> 
>      % grml-x -<TAB>
>      Completing - option
>      [...]
>      -help         -- [display help]
>      [...]
> 
> because in _grml-x there's defined:
> 
>     '-help:[display help]'

Yeah, well. I tried this with my zsh setup, which obviously does some
things differently then grml's setup. I am able to reproduce the
problem, using grml's setup.

However, I think your fix is not the best solution, we can provide. I
am attaching two exports. Please review. I *think* they are ready for
inclusion.

One minor bit, which requires fixing, too (I guess):

[snip]
-  '-display:display for xserver:(7 8)'
+  '-display[display for xserver]:display:(7 8)'
[snap]

'7' and '8' as the only completions for -display? Reason?


> > check_com() *would* be available for completions, too. I mean, in what
> > environment are you using compsys *without* being in an interactive
> > shell?
> Right.
> 
> > However, I tend to agree with you. Leave check_com() out.
> I guess, I did mean it the same way, but you obviously managed to
> explain it in a  more understandable way.

Just for the record:
  check_com() is available outside of our zshrc now.

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925
msg1157 (view) Author: z3ttacht Date: 2008-02-06.13:02:45
* Frank Terbeck <bts@bts.grml.org> [2008-02-06 13:32]:
> > check_com() *would* be available for completions, too. I mean, in what
> Wrong wrong wrong wrong...
> check_com() is currently *not* available outside of our zshrc.
> This has nothing to do with the (non-)interactive state of the shell,
> though. We are unfunctioning the function definition after the zshrc
> is sourced.
I knew it!!!1oneelven! :p
msg1156 (view) Author: z3ttacht Date: 2008-02-06.12:58:42
* Frank Terbeck <bts@bts.grml.org> [2008-02-06 12:25]:
> > And `help' is completing with brackets attached.
> > Culprit's the leading colon.
> Um, I just tried the completion. What is your problem with the way it
> currently works? I don't see any 'brackets attached'.
When completing, I get

     % grml-x -<TAB>
     Completing - option
     [...]
     -help         -- [display help]
     [...]

because in _grml-x there's defined:

    '-help:[display help]'

And according to the manual and my understanding, the colon's wrong
here.
    ,----[ man 1 zshcompsys | less -p '^\s+_arguments' ]-
    | optspec[explanation]
    | An  explanation  string may be appended to any of
    | the preceding forms of optspec by enclosing it in
    | brackets, as in ‘-q[query operation]’.
    | Just checked out the hg Repository again.
    | whereas a colon is, afaics, used to separate for messages and
    | actions.
    `----

Just checked out the hg Repository again.

> check_com() *would* be available for completions, too. I mean, in what
> environment are you using compsys *without* being in an interactive
> shell?
Right.

> However, I tend to agree with you. Leave check_com() out.
I guess, I did mean it the same way, but you obviously managed to
explain it in a  more understandable way.

---------------
P.S.: I marginally changed the diff concerning the brackets, because I
just found a 'typo'. It's the bracket at the end.

  % -mode   -- resolution-mode for xserver (<width>x<height> - % e.g. 1024x768)]
msg1155 (view) Author: ft Date: 2008-02-06.12:32:19
Frank Terbeck <ft@bewatermyfriend.org>:
[...]
> check_com() *would* be available for completions, too. I mean, in what
[...]

Wrong wrong wrong wrong...
check_com() is currently *not* available outside of our zshrc.
This has nothing to do with the (non-)interactive state of the shell,
though. We are unfunctioning the function definition after the zshrc
is sourced.

Regards, Frank
msg1154 (view) Author: ft Date: 2008-02-06.11:24:47
Alexander Steinböck <bts@bts.grml.org>:
> In grml-x' completion there's the switch `fallback' missing. As well
> as in the manpage. And `help' is completing with brackets attached.
> Culprit's the leading colon.

Um, I just tried the completion. What is your problem with the way it
currently works? I don't see any 'brackets attached'.

> Furthermore, done in a separate diff, I guess we should stick to
> double brackets for the test command here as well.

ACK.

> I first wanted to use check_com instead of `[[ -x ... ]]', but then
> realised, that's not available in noninteractive shells. Besides,
> it may be better to stay independent from grml's zsh-config for those
> (non-grml) users, who just checkout the completion. Or am I missing
> something in this regard?

Well, no. You are right. More or less.

check_com() *would* be available for completions, too. I mean, in what
environment are you using compsys *without* being in an interactive
shell?

However, I tend to agree with you. Leave check_com() out.
The reason it got implemented was to have a simple uniform way to
check for commands/aliases/functions etc. in various places in our
zshrc - because we check for more then one program in there. :-)


If you could the explain the 'brackets attached' thing above, I'd be
happy to apply this one. (A first quick look didn't reveal any
breakage).

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925
msg1153 (view) Author: z3ttacht Date: 2008-02-06.09:10:51
In grml-x' completion there's the switch `fallback' missing. As well
as in the manpage.
And `help' is completing with brackets attached. Culprit's the leading
colon.

Furthermore, done in a separate diff, I guess we should stick to
double brackets for the test command here as well.
I first wanted to use check_com instead of `[[ -x ... ]]', but then
realised, that's not available in noninteractive shells. Besides,
it may be better to stay independent from grml's zsh-config for those
(non-grml) users, who just checkout the completion. Or am I missing
something in this regard?
History
Date User Action Args
2008-03-01 08:58:32ftsetnosy: mika, ft, z3ttacht
messages: + msg1233
2008-02-22 22:37:20ftsetnosy: mika, ft, z3ttacht
messages: + msg1219
2008-02-22 22:31:30mikasetnosy: mika, ft, z3ttacht
messages: + msg1218
2008-02-22 22:26:08z3ttachtsetnosy: mika, ft, z3ttacht
messages: + msg1217
2008-02-22 14:19:55ftsetfiles: + grml-x-1of2-dd65614ab2c7.diff, grml-x-2of2-431dbba93cd0.diff
nosy: mika, ft, z3ttacht
messages: + msg1214
2008-02-06 13:02:46z3ttachtsetnosy: mika, ft, z3ttacht
messages: + msg1157
2008-02-06 12:58:42z3ttachtsetfiles: + grml-x_double-brackets-typo_corr.diff
nosy: mika, ft, z3ttacht
messages: + msg1156
2008-02-06 12:32:20ftsetnosy: mika, ft, z3ttacht
messages: + msg1155
2008-02-06 11:24:48ftsetstatus: unread -> chatting
nosy: mika, ft, z3ttacht
messages: + msg1154
2008-02-06 09:10:53z3ttachtcreate