[aprssig] TNC command formats

Scott Miller scott at opentrac.org
Wed Mar 16 18:25:35 EST 2005


> Why not use TAB to complete the commands like some Unix/Linux shells?
>
> I rather like being able to type part of the command and press tab to
> have the shell finish it, or show the matches to the partial typed
command.

Took a crack at it - got the command matching code nicely separated out and
cleaned up so I could reuse it for command completion, but ran into a snag.
It'd be a lot easier if I was using case-sensitive commands, like Unix - as
it is, I've got to convert the input string to upper case before matching,
and the case of the completed portion of the command wouldn't necessarily
match what you'd entered.  You'd get ver<tab>SION.  Not that bad, but the
lack of a case-insensitive string compare makes it harder.  If I think of a
clean way to do it, I'll try.

An alternative (that wouldn't reuse the same code) might just print all
matches...

cmd:h<tab>
HBAUD
HELP
HTEXT
cmd:h

That should be fairly easy to do.  Of course, you don't need to enter the
whole command anyway if you've got the unique part:

cmd:ver
Argent Data Systems DC-1  Firmware Version 0.1
Copyright (C) 2004-2005 Argent Data Systems

FreeRTOS V2.6.1 - Copyright (C) 2003 - 2005 Richard Barry


Back to coding.  I've got VERSION, HELP, and RESET implemented already.  =]
DIR is going to be a whole lot more work...

Scott
N1VG





More information about the aprssig mailing list