Author Topic: Passing Parameters to tools  (Read 4996 times)

jpau1953

  • Guest
Passing Parameters to tools
« on: August 11, 2009, 06:37:25 PM »
I am evaluating HE as a replacement for my current editor. In order to use my existing makefiles and compiler tools from HE I need to pass in the file name with no extension. Is this possible?

Offline Arthur

  • Registered User
  • Hero Member
  • *
  • Posts: 653
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • My Blog
Re: Passing Parameters to tools
« Reply #1 on: August 11, 2009, 07:30:47 PM »
Hello jpau1953, and welcome aboard!

I am sure You will find HippoEdit a wonderful replacement to your current editor.

I suggest using the top option for current file name %Document% found in the Manage Tools -> Argument (or using the arrow).
It is in case you have this file w/o the extension loaded into HE.
Frankly, I am curious why one would need to not to specify an extension?

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2224
  • Karma: +37/-3
    • HippoEDIT
Re: Passing Parameters to tools
« Reply #2 on: August 11, 2009, 10:08:24 PM »
Hi jpau1953,

welcome. Currently there is no tag to get document name without extension. You only can get a file name with extension using tag %Document% as suggested by Arthur.
If you would explain why this is necessary I can add the tag with new beta -  it is not complex.

Best regards,
Alex.

jpau1953

  • Guest
Re: Passing Parameters to tools
« Reply #3 on: August 12, 2009, 02:00:39 PM »
I have tried to reply 3 times now an every time I submit the reply the forum says I timed out. I'll try again...

The reason for needinf the filename without extension is the structure of our makefiles. They want a target file with a ".o" or ".obj" extension as a command line argument. Changing hundreds of makefiles and retesting them really isn't an option.

The editor currently used is Codewright and it has many tags that can be passed to external tools.

%r is the root filename I'd put more but I'm afraid I'll timeout

Thanks


Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2224
  • Karma: +37/-3
    • HippoEDIT
Re: Passing Parameters to tools
« Reply #4 on: August 12, 2009, 03:20:34 PM »
Strange, I do not get problems with timeout... Maybe server was overloaded, or some crawler was intensively running..

About the request. Ok, now clear. The new tag for current file name without extension would be added with new beta. But maybe better way would be integration of regular expression in templates engine, then you can just do a post processing of the result. But this is too much work for 1.4x, maybe would be added 1.5x.

Another thing I noticed, probably I would introduce more shorter aliases for tag names, to have something like %d% instead of %Document% and so on...

Best regards,
Alex.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
Re: Passing Parameters to tools
« Reply #5 on: October 03, 2009, 09:44:37 PM »
EDIT: 
i do currently collect all vars in an another thread with explanation and examples.
I will also provide an collection of shortcuts for this vars.
Than we can discuss this about this collection.





Hi Alex, i think this spelling is not that good for remembering them,
%Document%
%FileNameWOExt%

"Document Name" item could be named "File name" in in the context menu
as in that context menu there is used 'file' for other items too.
%Document% could be %FileName%

But the item "Path and name of file" give us currently already %FileName% too... this could be named %FullName%


%FileNameWOExt% could be %BaseName% or %FileBase%
as 'base' is an common used  with renamer-app too.



... and the extension part is missing as token on it's own  ==> %ext%



But, What do you think about
having the item "Document Name" respective "File name"
simple insert an token like %FileName%.%ext%
so you save space in this ctx menu and fit all needs
as one can take what he need to set up his tool:
 %FileName%.%ext%
or
 %FileName%.bak
or
NewName.%ext%
or
 %FileName%_backup.%ext%



Now that i am on it
i see that %Date% and %Time% are also missed from this ctx menu.
(If someone need them right now: they could be found at CodeTemplates)
 %FileName%_bak_%Date%.%ext%


I mean you could make a note for later
to pimp this ctx menu by adding
some sub-menus like ">> Project" and ">>Interactive"
and then add more %placeholder%-vars.


And i would like to remind to add some more default env vars to the menus
like %ComputerName% , %UserName% and %ProgramFiles% and like this
so that it is more obvious for new users that this could be used too.
 %FileName%_bak_%ComputerName%_%UserName%_%Date%.%ext%
(If someone need them right now: they could be found by opening an DOS-Box and type in set)

Therfore this could be dropped:
%FP_NO_HOST_CHECK%
%NUMBER_OF_PROCESSORS%
%PROCESSOR_xxx%
« Last Edit: October 03, 2009, 11:14:15 PM by Stefan »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2224
  • Karma: +37/-3
    • HippoEDIT
Re: Passing Parameters to tools
« Reply #6 on: October 03, 2009, 11:56:53 PM »
Hi Stefan,

sounds good. The template tag names were growing evolutionary, and there was no special "go through" to normalize them. So, if you can collect a list, publish, then we and other users can verify it, and then I would do the change.
There is a problem possible that existing templates would work wrong, but maybe, if name would not overlap, we can leave both version.

Also I had idea some when before to provide short aliases for tag names, something like w for current word etc. I have seen that somewhere.

But I would not do such change on 1.4x branch. Better on 1.50 as a major update, plus this can be combined with some other extensions I planned for templates as another texmate like style for tags etc (${}) to make easier to migrate snippets from other editors.

And about suggested environment variables, they are not hardcoded, but generated from currently registered, so it is complex to remove something, but probably some can be explicitly moved to main sub menu.

Best regards,
Alex
« Last Edit: October 03, 2009, 11:59:25 PM by alex »