Page 1 of 1

shell info command improvement

Posted: Thu Jul 28, 2016 3:27 pm
by sdalu
Hi

It would be nice to have the "info" command listing the hal drivers that have been compiled in, something like:

Code: Select all

  chprintf(chp, "HAL drivers: %s"SHELL_NEWLINE_STR,
      ""
#if defined(HAL_USE_RTC) && HAL_USE_RTC
      " RTC"
#endif
#if defined(HAL_USE_PAL) && HAL_USE_PAL
      " PAL"
#endif

Re: shell info command improvement

Posted: Thu Jul 28, 2016 3:29 pm
by Giovanni
Not a bad idea, some configuration options could also be listed.

Giovanni

Re: shell info command improvement

Posted: Thu Jul 28, 2016 3:41 pm
by sdalu
Also it would be very convenient if it was possible to extend the info command with new information, perhaps something like

shell_cmd.h

Code: Select all

#if defined(SHELL_CMD_INFO_EXTRA)
SHELL_CMD_INFO_EXTRA(BaseSequentialStream *chp, int argc, char *argv[]);
#endif


shell_cmd.c

Code: Select all

static void cmd_info(BaseSequentialStream *chp, int argc, char *argv[]) {

// ....

#if defined(SHELL_CMD_INFO_EXTRA)
SHELL_CMD_INFO_EXTRA(chp, argc, argv);
#endif
}

Re: shell info command improvement

Posted: Thu Jul 28, 2016 5:05 pm
by RoccoMarco
What about arguments?
info [rt | hal]

Re: shell info command improvement

Posted: Thu Jul 28, 2016 5:11 pm
by Giovanni
[rt|hal|ex|all]

Giovanni

Re: shell info command improvement

Posted: Tue Apr 25, 2017 9:25 am
by Giovanni
bump

Re: shell info command improvement

Posted: Wed Jun 07, 2017 9:40 pm
by RoccoMarco
This is very interesting!