Page 7 of 10

Re: Передать имя файла в редактор

Posted: Thu 06 Dec, 2012 16:31
by HaRT

Latest post of the previous page:

2useven10 wrote:imho достаточно научить farcmds ставить временному файлу нужное расширение.
Есть случаи, когда схема раскраски определяется именем файла, но не (только) расширением, и Колорер это умеет.

Re: Передать имя файла в редактор

Posted: Thu 06 Dec, 2012 17:23
by 2useven10
да. нужна временная папка. удалять её просмотрщик и редактор умеют.
кроме мультиарка такие временные файлы делает и стандартный фтп.
add: ещё конечно нужна возможность задавать нужное имя...

Re: FarCmds (FAR Commands)

Posted: Wed 16 Jan, 2013 10:00
by Raistlin

Code: Select all

edit:<dir
работает как ожидается.

Code: Select all

edit:<1 dir
открывает пустой редактор, при этом в комстроке мелькает что-то насчет "... not recognized as internal command...".
ЧЯДНТ? Far 3.0.3085

Re: FarCmds (FAR Commands)

Posted: Wed 16 Jan, 2013 10:17
by cyberwolf
Raistlin wrote:

Code: Select all

edit:<dir
работает как ожидается.

Code: Select all

edit:<1 dir
открывает пустой редактор, при этом в комстроке мелькает что-то насчет "... not recognized as internal command...".
ЧЯДНТ? Far 3.0.3085
As far as I know, the "<" sign shows that what's after it is the "input source", so in the case of the command "edit:<1 dir" the input source would be the "1 dir" command which doesn't work, that's why you get the "not recognized as internal command" error.
Whatever you write after the "edit:<" part must be a correct command, as in a command that if you run in the command line doesn't show an error message,

p.s. sorry for writing in English, i don't know Russian and don't trust the online translators.

Re: FarCmds (FAR Commands)

Posted: Wed 16 Jan, 2013 11:12
by Raistlin
As far as I know, the "<" sign shows that what's after it is the "input source"
The syntax I used is taken right from FAR Commands help, so I believe there is an error there, or it's a bug, or I misunderstand something completely.

Code: Select all

view: <1> dir
and

Code: Select all

view: <1>dir
work OK, while same constructions with "edit:" don't.

Code: Select all

view:<1>dir
doesn't work as well.

Re: FarCmds (FAR Commands)

Posted: Wed 16 Jan, 2013 11:39
by HaRT
Raistlin
Can you please quote the exact Help lines you mention?

Re: FarCmds (FAR Commands)

Posted: Wed 16 Jan, 2013 11:48
by Raistlin
Examples:

Execute the command "command" and redirect its output to the editor:
edit:<command

Possible cases with the parameter stream=1:
edit:<1 command

Re: FarCmds (FAR Commands)

Posted: Wed 16 Jan, 2013 12:00
by cyberwolf
I've checked the FarCmds help and you're right, the "<1" and "<2" are special command, sadly it doesn't seem to work.

Btw, the "<1" doesn't work, but the "<<1" does work, so you should use the following code (for the "dir" command it should do the same as the "<1" command):

Code: Select all

edit:<<1 dir
I don't know if it's intended to work like that or just a bug, from the help i get the idea that both "<1" and "<<1" should work.

Oh, and here's the part from FARCmdsEng.hlf regarding the stream settings :

Code: Select all

The plugin can redirect the output of the specified "<command" or "<<command". 
                                                                               
 command - [stream][mode][|path|]command.                                      
                                                                               
 stream - controls which output stream(s) to redirect.                         
          1 - redirect only standard output stream stdout.                     
          2 - redirect only standard output stream stderr.                     
          * - redirect stderr and stdout as one stream.                        
          ? - redirect stderr and stdout as different streams.                 
              For commands view and edit the streams will be opened            
              in separate windows. For other commands same behavior as *.      
          Default value of this parameter can be defined in config.
and even gives a sample (that doesn't work :( ) at the end :

Code: Select all

Examples:                                                            
                                                                     
 Execute the command "command" and redirect its output to the editor:
   edit:<command                                                     
                                                                     
 Possible cases with the parameter stream=1:                         
   edit:<1 command                                                   
   edit:<1"command"                                                  
   edit:<1+command                                                   
   edit:<1|%TEMP%|command
The examples only work if you use the double sign ("<<").

Re: FarCmds (FAR Commands)

Posted: Wed 16 Jan, 2013 12:14
by Raistlin
from the help i get the idea that both "<1" and "<<1" should work
"<<1" is the undocumented syntax: according to Help mode should follow stream, not vice versa:
command - [stream][mode][|path|]command

Re: FarCmds (FAR Commands)

Posted: Thu 24 Jan, 2013 22:37
by Raistlin

Re: FarCmds (FAR Commands)

Posted: Sun 08 Jun, 2014 19:23
by John Doe
Префикс far: теперь используется фаром.
Надо бы из плагина убрать, он там не особо нужен.

Сейчас при запуске префикса far: получаем справку плагина.

Update: http://bugs.farmanager.com/view.php?id=2701

Re: FarCmds (FAR Commands)

Posted: Tue 17 Jun, 2014 21:56
by White_Owl
Хотелка:
Хочу чтобы команда goto умела читать lnk файлы и переходить по ним (EMenu умеет их создавать, значит надо уметь их использовать).
Синтаксис можно оставить прежним. goto: <some.lnk
То есть, если файл текстовый - работать в прежнем режиме, если бинарный и с расширением lnk - прочитать, расшифровать и перейти куда сказано.

Re: FarCmds (FAR Commands)

Posted: Wed 18 Jun, 2014 11:36
by Skirda
White_Owl wrote:Хотелка:
Хочу чтобы команда goto умела читать lnk файлы и переходить по ним
В аттаче оно?

Re: FarCmds (FAR Commands)

Posted: Thu 19 Jun, 2014 14:52
by Skirda
В общем "goto:<some.lnk" закоммитил - build 103.

Re: FarCmds (FAR Commands)

Posted: Mon 07 Jul, 2014 06:29
by Skirda
Префикс "run:" актуален?
Кто юзает, поделитесь примерами (для понимания масштабов бедствия, если префикс убрать)

Re: FarCmds (FAR Commands)

Posted: Mon 07 Jul, 2014 09:31
by John Doe
Бедствия не предвидится, но зачем убирать?
Да, почти то же самое можно сделать одним только cmd.exe, но:
  • У run общий синтаксис с остальными командами FarCmds, что делает использование проще
  • run ищет запускаемые утилиты в большем числе мест, чем cmd.
    Может запускать и алиасы
  • Процесс перенаправления вывода сопровождается выводом прогресса.
    Больше возможностей по скрытию/отображению вывода (или я не умею пользоваться cmd)