Recent

Author Topic: How can I open lazarus project in ide from command line?  (Read 9772 times)

dvhx

  • New Member
  • *
  • Posts: 22
How can I open lazarus project in ide from command line?
« on: December 19, 2022, 11:14:32 am »
I want to open existing lazarus project from the command line. When I pass project file, it simply opens the most recent project, not the project I pass as argument. I tried:

startlazarus test.lpr
startlazarus test.lpi
lazarus-ide test.lpr
lazarus-ide test.lpi

None of it works, I always get project that was last opened in ide, not this one. I'm using Lazarus 2.2.0 on Ubuntu 22.04


rvk

  • Hero Member
  • *****
  • Posts: 6953
Re: How can I open lazarus project in ide from command line?
« Reply #1 on: December 19, 2022, 11:21:06 am »
Don't use startlazarus in that case (it doesn't pass the parameter).

Use lazarus (the lazarus executable).

(I'm not sure what lazarus-ide is for you)

dvhx

  • New Member
  • *
  • Posts: 22
Re: How can I open lazarus project in ide from command line?
« Reply #2 on: December 20, 2022, 09:20:04 am »
Ok, I found it. There is trickery via /etc/alternatives where the argument is lost, but when I call this directly it works:

/usr/lib/lazarus/2.2.0/lazarus test.lpr

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12209
  • Debugger - SynEdit - and more
    • wiki
Re: How can I open lazarus project in ide from command line?
« Reply #3 on: December 20, 2022, 01:24:14 pm »
Ok, I found it. There is trickery via /etc/alternatives where the argument is lost, but when I call this directly it works:

/usr/lib/lazarus/2.2.0/lazarus test.lpr

When you install packages, the ide (the lazarus exe) is rebuild. And the new lazarus will then be somewhere in ~/.lazarus/*/

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4699
  • I like bugs.
Re: How can I open lazarus project in ide from command line?
« Reply #4 on: December 20, 2022, 10:35:13 pm »
Parameter passing to StartLazarus works again in "main" development branch. Mattias fixed it. See :
 https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40044
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018