FarCmds (FAR Commands)

Здесь можно обсудить ваш любимый плагин.
User avatar
HaRT
Moderator
Posts: 10858
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 221 times
Been thanked: 358 times

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

Post by HaRT »

Latest post of the previous page:

2useven10 wrote:imho достаточно научить farcmds ставить временному файлу нужное расширение.
Есть случаи, когда схема раскраски определяется именем файла, но не (только) расширением, и Колорер это умеет.
Фар есть инструмент, а не нянька. © 2009 DrKnS
2useven10
Posts: 5226
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 18 times
Been thanked: 314 times

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

Post by 2useven10 »

да. нужна временная папка. удалять её просмотрщик и редактор умеют.
кроме мультиарка такие временные файлы делает и стандартный фтп.
add: ещё конечно нужна возможность задавать нужное имя...
User avatar
Raistlin
Posts: 750
Joined: Wed 16 Mar, 2005 16:01
Has thanked: 3 times
Been thanked: 1 time

Re: FarCmds (FAR Commands)

Post by Raistlin »

Code: Select all

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

Code: Select all

edit:<1 dir
открывает пустой редактор, при этом в комстроке мелькает что-то насчет "... not recognized as internal command...".
ЧЯДНТ? Far 3.0.3085
Magically yours
Raistlin
cyberwolf
Posts: 109
Joined: Tue 24 Mar, 2009 14:39
Been thanked: 2 times

Re: FarCmds (FAR Commands)

Post 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.
Sorry for writing in English in the Russian forums, but i don't speak Russian and don't trust online translators. :D

"There’s no teacher who can teach anything new He can just help us to remember the things we always knew." ~ ENIGMA
User avatar
Raistlin
Posts: 750
Joined: Wed 16 Mar, 2005 16:01
Has thanked: 3 times
Been thanked: 1 time

Re: FarCmds (FAR Commands)

Post 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.
Magically yours
Raistlin
User avatar
HaRT
Moderator
Posts: 10858
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 221 times
Been thanked: 358 times

Re: FarCmds (FAR Commands)

Post by HaRT »

Raistlin
Can you please quote the exact Help lines you mention?
Фар есть инструмент, а не нянька. © 2009 DrKnS
User avatar
Raistlin
Posts: 750
Joined: Wed 16 Mar, 2005 16:01
Has thanked: 3 times
Been thanked: 1 time

Re: FarCmds (FAR Commands)

Post 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
Magically yours
Raistlin
cyberwolf
Posts: 109
Joined: Tue 24 Mar, 2009 14:39
Been thanked: 2 times

Re: FarCmds (FAR Commands)

Post 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 ("<<").
Sorry for writing in English in the Russian forums, but i don't speak Russian and don't trust online translators. :D

"There’s no teacher who can teach anything new He can just help us to remember the things we always knew." ~ ENIGMA
User avatar
Raistlin
Posts: 750
Joined: Wed 16 Mar, 2005 16:01
Has thanked: 3 times
Been thanked: 1 time

Re: FarCmds (FAR Commands)

Post 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
Magically yours
Raistlin
User avatar
Raistlin
Posts: 750
Joined: Wed 16 Mar, 2005 16:01
Has thanked: 3 times
Been thanked: 1 time

Re: FarCmds (FAR Commands)

Post by Raistlin »

Magically yours
Raistlin
User avatar
John Doe
Бюрократ
Posts: 13851
Joined: Wed 27 Apr, 2005 20:42
Has thanked: 73 times
Been thanked: 428 times
Contact:

Re: FarCmds (FAR Commands)

Post by John Doe »

Префикс far: теперь используется фаром.
Надо бы из плагина убрать, он там не особо нужен.

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

Update: http://bugs.farmanager.com/view.php?id=2701
White_Owl
Posts: 16
Joined: Thu 06 Feb, 2014 23:07

Re: FarCmds (FAR Commands)

Post by White_Owl »

Хотелка:
Хочу чтобы команда goto умела читать lnk файлы и переходить по ним (EMenu умеет их создавать, значит надо уметь их использовать).
Синтаксис можно оставить прежним. goto: <some.lnk
То есть, если файл текстовый - работать в прежнем режиме, если бинарный и с расширением lnk - прочитать, расшифровать и перейти куда сказано.
User avatar
Skirda
Posts: 3475
Joined: Wed 16 Mar, 2005 11:01
Been thanked: 8 times

Re: FarCmds (FAR Commands)

Post by Skirda »

White_Owl wrote:Хотелка:
Хочу чтобы команда goto умела читать lnk файлы и переходить по ним
В аттаче оно?
Attachments
farcmds_103.zip
(29.28 KiB) Downloaded 145 times
We are the Borg. You will be assimilated.
So Say We All!
User avatar
Skirda
Posts: 3475
Joined: Wed 16 Mar, 2005 11:01
Been thanked: 8 times

Re: FarCmds (FAR Commands)

Post by Skirda »

В общем "goto:<some.lnk" закоммитил - build 103.
We are the Borg. You will be assimilated.
So Say We All!
User avatar
Skirda
Posts: 3475
Joined: Wed 16 Mar, 2005 11:01
Been thanked: 8 times

Re: FarCmds (FAR Commands)

Post by Skirda »

Префикс "run:" актуален?
Кто юзает, поделитесь примерами (для понимания масштабов бедствия, если префикс убрать)
We are the Borg. You will be assimilated.
So Say We All!
User avatar
John Doe
Бюрократ
Posts: 13851
Joined: Wed 27 Apr, 2005 20:42
Has thanked: 73 times
Been thanked: 428 times
Contact:

Re: FarCmds (FAR Commands)

Post by John Doe »

Бедствия не предвидится, но зачем убирать?
Да, почти то же самое можно сделать одним только cmd.exe, но:
  • У run общий синтаксис с остальными командами FarCmds, что делает использование проще
  • run ищет запускаемые утилиты в большем числе мест, чем cmd.
    Может запускать и алиасы
  • Процесс перенаправления вывода сопровождается выводом прогресса.
    Больше возможностей по скрытию/отображению вывода (или я не умею пользоваться cmd)
Post Reply

Return to “Обсуждение плагинов”