Menu

#2 Problem with Cmdinfo macros

1.0
open
zacmarco
None
2017-01-27
2016-12-21
Ray Silagi
No

Hi Zac,
I'm wondering if there is a new version. I found a couple of minor problems in the version I have. In the cli.h there are some problems with the macros:

click_get_param_num(cmdinfo) and click_get_param_name(cmdinfo,parmnum)

The element paramtotnum and paramlist are not what is in struct cmdInfo. Also, when the macro's are expanded:

p_name = ( if(cmdinfo->paramlist[parnum] && parnum<=cmdinfo->paramtotnum) \ cmdinfo->paramlist[parnum]->name \ else \ NULL)

will not compile. My compiler does not allow an if statement as the right-side statement.

Please let me know the correct version to get. This is URL I'm using, with Buildroot:

http://sourceforge.net/projects/click-lib/files/click-0.1.tar.bz2

Also, how much work is it to change clickbuilder to allow comments and spaces in command names.

Ray S.

Discussion

  • zacmarco

    zacmarco - 2017-01-21

    Hi Ray,

    sorry for the delay, I had a very busy start of the year.
    What I would suggest is to get the latest development branch. Easiest way is to use git, performing this command

    git clone git://git.code.sf.net/p/click-lib/code click-lib-code

    Not sure, BTW, about your last request.
    I guess you need the ability to add comments in the .xml file. That can be done, I need to spend some time on the parser, but definitely doable. Let me work on that one.

    Spaces in command name, in the context of CLIck, do not make much sense, if you need to have commands made of two or more words (like "list files"), what you are looking for is subcommands.

    If this is not what you are looking for, can you please give me more context about your request?

    Thanks

    Regards

    Marco

     
  • Ray Silagi

    Ray Silagi - 2017-01-27

    Hey,
    So, thanks for fixing the comments in the XML file. I would like to add some extra info about some of the commands or why these commands are grouped. You are right about the spaces. I've found it is better to make sub-commands instead of have longer commands with spaces. It is better to have unique commands so the tab completion works better.

    Let me know when you are able to get around to fixing the comment thing. Thanks again for a great CLI.

    Ray S.

     
    • zacmarco

      zacmarco - 2017-02-10

      Hi Ray,

      just added the possibility of putting HTML-style comments in XML file.
      Please check-out the latest master branch from git. An example can be found
      in examples/testtool

      Thanks

      Marco

      2017-01-27 2:03 GMT+01:00 Ray Silagi rsilagi@users.sf.net:

      Hey,
      So, thanks for fixing the comments in the XML file. I would like to add
      some extra info about some of the commands or why these commands are
      grouped. You are right about the spaces. I've found it is better to make
      sub-commands instead of have longer commands with spaces. It is better to
      have unique commands so the tab completion works better.

      Let me know when you are able to get around to fixing the comment thing.
      Thanks again for a great CLI.

      Ray S.

      Status: open
      Milestone: 1.0
      Created: Wed Dec 21, 2016 07:37 PM UTC by Ray Silagi
      Last Updated: Sat Jan 21, 2017 09:43 AM UTC
      Owner: zacmarco

      Hi Zac,
      I'm wondering if there is a new version. I found a couple of minor
      problems in the version I have. In the cli.h there are some problems with
      the macros:

      click_get_param_num(cmdinfo) and click_get_param_name(cmdinfo,parmnum)

      The element paramtotnum and paramlist are not what is in struct cmdInfo.
      Also, when the macro's are expanded:

      p_name = ( if(cmdinfo->paramlist[parnum] && parnum<=cmdinfo->paramtotnum)
      \ cmdinfo->paramlist[parnum]->name \ else \ NULL)

      will not compile. My compiler does not allow an if statement as the
      right-side statement.

      Please let me know the correct version to get. This is URL I'm using, with
      Buildroot:

      http://sourceforge.net/projects/click-lib/files/click-0.1.tar.bz2

      Also, how much work is it to change clickbuilder to allow comments and
      spaces in command names.

      Ray S.

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/click-lib/tickets/2/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      Il driver driverizza!!!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.