celix icon indicating copy to clipboard operation
celix copied to clipboard

Pass (argc, argv) in Shell interface

Open PengZheng opened this issue 2 years ago • 1 comments

The main advantages of using (argc, argv) over a single string CommandLine are:

  • Avoid all the hassle of strdup/strtok.
  • Deal with command line argument containing white spaces correctly.
  • Make integrating with 3rd party library wuch as https://github.com/argtable/argtable3 easier.

Originally posted by @PengZheng in https://github.com/apache/celix/pull/476#discussion_r1111655952

PengZheng avatar Mar 13 '23 06:03 PengZheng

I think this can be done by introducing a new shell command interface (v2) based on the current one: https://github.com/apache/celix/blob/rel/celix-2.3.0/bundles/shell/shell/api/celix_shell_command.h

We currently already support 2 shell commands version and if we remove the current deprecated version ( https://github.com/apache/celix/blob/rel/celix-2.3.0/bundles/shell/shell/deprecated_api/command.h) when preparing for a Apache Celix 3.0.0 we could introduce a argc/argv variant and deprecated celix_shell_command.h.

pnoltes avatar Apr 03 '23 15:04 pnoltes