Array of string param. is it possible?

9 views
Skip to first unread message

Loc Tran

unread,
Nov 1, 2020, 2:26:52 PM11/1/20
to klish-dev
Hi all,

I'm trying to use Klish with the capacity of support array of string param.
The command line param prompt will depend on the Entry number in an array. For example:
 EntryNumber: 3
 entri[0]: a0
 entri[1]: a1
 entri[0]: a2
Could it possible in Klish?

Thank you,
Loc Tran

Serj Kalichev

unread,
Nov 2, 2020, 4:29:46 AM11/2/20
to klis...@googlegroups.com
Hi
I can't understand the question.
If you mean command with unknown number of the parameters with the same type - it's not possible now.
If you mean interactive script then you can write any script you like.
If you mean command with set of parameters with visibility depend on condition see "test" field.


01.11.2020 22:26, Loc Tran пишет:
--
You received this message because you are subscribed to the Google Groups "klish-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/klish-dev/f3539aa5-1b33-43f5-bb63-7dc718da7c1an%40googlegroups.com.


Ingo Albrecht

unread,
Nov 20, 2020, 9:04:20 AM11/20/20
to klis...@googlegroups.com
On 11/2/20 10:29 AM, Serj Kalichev wrote:
> Hi
> I can't understand the question.
> If you mean command with unknown number of the parameters with the same
> type - it's not possible now.
> If you mean interactive script then you can write any script you like.
> If you mean command with set of parameters with visibility depend on
> condition see "test" field.

This is somewhat related to the fact that most POSIX shells do not have
array support and need special support for "magic" expansions like "$@"
with double quotes.

I have been doing some heavy sh/bash programming recently...



== Greenspun's tenth rule of programming

This goes well with an argument that I made earlier:

It's always a bit dangerous to extend a "simple tool" into a programming
language. You end up with a solution that often has some details missing.

What I'm saying is also called "Greenspun's tenth rule":

"Any sufficiently complicated C or Fortran program contains an ad hoc,
informally-specified, bug-ridden, slow implementation of half of Common
Lisp."
Reply all
Reply to author
Forward
0 new messages