It's all about the answers!

Ask a question

What is the proper order for this lscm compare command?


Andy Jewell (24236174) | asked Feb 09 '18, 12:51 p.m.
Normally I wouldn't post something like this because it's just something I'd move on and maybe never get to the bottom of.  However, this type of problem seems to get me now and then with lscm.  Like if the arguments are not in the "right" order.  In any case, here's my problem.  I want to compare my workspace to the current component baseline.  Well, that would be ideal but I don't know if it's possible to compare to the "current" baseline so I'm comparing to a specific baseline here:

C:\>lscm compare -c buildlib workspace "buildfix major dev o386600" baseline "buildlib-2.0"
    
Argument syntax error:
    
Missing arguments to subcommand "compare" - new-type, new, old-type, old. Try 'lscm help compare' for more information.
    
Usage: lscm compare [-r/--repository-uri <arg>] [-u/--username <arg>
    
                    -P/--password <arg> | -u/--username <arg> --password-file
    
                    <arg> | --certificate <arg> -P/--password <arg> |
    
                    --smartCard -u/--username <arg> | --kerberos |
    
                    --integratedWindows] [-j/--json] [-I/--include-types
    
                    <arg>] [-C/--format-contributor <arg>] [-D/--format-date
    
                    <arg>] [-S/--show <arg>] [-f/--flow-directions <arg>]
    
                    [-w/--reroot <arg>] [-p/--prune <arg>]  [-c/--components
    
                    <arg ...>] <new-type> <new> <old-type> <old>
    
C:\>lscm compare  workspace "buildfix major dev o386600" baseline "buildlib-2.0"
    
Problem running 'compare':
    
Specify component along with the baseline. Try 'lscm help compare' for more information.
    

So in the first case it seems to confuse my component (buildlib), new type (workspace), new selector, etc., but if I leave the component off it tells me to put it back.

What's the trick to this command??

Accepted answer


permanent link
Donald Nong (14.5k414) | answered Feb 12 '18, 7:39 p.m.

The command works best when you use alias or UUID, and you will get the strange syntax error when using names due to the ambiguity (perhaps?). If you need to specify the component(s), put the -c after the four mandatory parameters, rather than "before" as shown in the syntax.

Andy Jewell selected this answer as the correct answer

Comments
Andy Jewell commented Feb 13 '18, 11:27 a.m.

Thanks, I should have thought of that - namely, using UUID for the component.  When I used the alias I had the same result (not recognized).  When I used the UUID it gave me an error that the component wasn't in the baseline.  I guess somehow that error condition isn't caught when using the name and it decides to throw the other error condition.


Also, putting the -c option on the other side of the mandatory arguments was a new one but it also did seem to help the parser grok what I wanted.  Thanks for your tips!

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.