ticat icon indicating copy to clipboard operation
ticat copied to clipboard

Smarter `args.auto = *`, ignore provided env key-values

Open innerr opened this issue 2 years ago • 0 comments

Currently, the prop in a command's meta file args.auto = <arg-list> is a complicated feature:

  • Support args.auto = arg1, arg2, arg3,... to auto map commands from subflow to this command
    • Support abbrs of args
  • Support args.auto = arg1, non-mapping-arg = def-val, arg3,... to embed regular args in the auto mapping args list
    • This is for developer can specify the order of args (some from auto mapping, some are regular)
  • Support args.auto = ** to do full mapping
  • Support args.auto = * to do smart mapping: map all but provided env key-values
  • Support args.auto = arg1, non-mapping-arg = def-val, arg3,* to do the smart mapping and cloud specify some args' order
  • Support args.auto = arg1, non-mapping-arg = def-val, arg3,** to do full mapping and cloud specify some args' order

But smart mapping is not well implemented yet:

  • If some env key-values are provided by [arg2env] and the arg have default-value, they will not be mapped
  • If some env key-values are provided by [val2env], they will not be mapped
  • If some env key-values are provided by [env] with write op, they will not be mapped
  • Could improve (not implemented):
    • If some env key-values are provided by [arg2env] and the arg's default-value is empty, they will be mapped now
      • If the arg/args are provided when calling this command, they should not be mapped
    • If env key-values are provided by {...} in flow, they should not be mapped
    • Some env commands like env.set should affect the smart mapping

innerr avatar Jul 26 '22 12:07 innerr