Orange-Cyberdefense/arsenal

args uniqueness

Opened this issue · 2 comments

Hello,

I don't know if this is the proper place to exchange on modification, but as I'm starting to work on adding the concept of option that can be either constant string or a mix on constant and args (see my comments in Issues open on optional args), I realized that there is something that is bothering me in the way args are managed. Right now for me they are more named place holder, because args having the same name can have different values.

As I consider it, a command needs args and an arg can be used in several location of the command representation.
example:

$ cp --help
Usage: cp [OPTION]... [-T] SOURCE DEST

Declaring cp <path> <path> it's not declaring the arguments of cp.

Do you agree if we do perform code modification to args and not named place holder. This means that args will be unique and written at different place of the command.

The impact will be on such declaration :
example cmd <arg_1|Default_value_1>... <arg_1|Default_value_2>

arg_1 has two default value, So the last one will be the one set (Default_value_2) or the first one.
If you agree I could make a first pull request before adding these changes then Ill work on options.

here is some example of the results
2024-05-24_05-34
2024-05-24_05-34_1

Hey !
we will take a look at this in the next code review
thanks