Home Download Buy Blog Forum Support

Calling commands from command line

Calling commands from command line

Postby daniel.csovari on Fri Nov 08, 2013 1:33 pm

I'd like to know if it is possible to call commands that have arguments from the command line.
For example this simple command works:
Code: Select all
subl --command indent

and it will indent the current line in the active view.
But when I try to call commands that need extra arguments like 'scroll_lines' which needs an 'amount' argument either nothing happens or I get an "Unable to parse command" error on the console output.
The real use case would be to use Sublimerge as an external diff and merge tool from an other IDE, but the command 'sublimerge_compare_selected_files' needs a file list argument and I can't make it work.
Is it even possible to do this with Sublime Text, and if so what would be the correct syntax?
daniel.csovari
 
Posts: 2
Joined: Fri Nov 08, 2013 1:25 pm

Re: Calling commands from command line

Postby quarnster on Fri Nov 08, 2013 2:38 pm

This works for me:
Code: Select all
subl --command "scroll_lines {\"amount\": 10}"
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: Calling commands from command line

Postby daniel.csovari on Fri Nov 08, 2013 3:02 pm

Works perfectly, thank you very much!
daniel.csovari
 
Posts: 2
Joined: Fri Nov 08, 2013 1:25 pm

Re: Calling commands from command line

Postby imocoder on Sat Nov 09, 2013 4:05 pm

It seems that is not working on Linux.
imocoder
 
Posts: 7
Joined: Fri Oct 11, 2013 12:03 pm

Re: Calling commands from command line

Postby Voaxeyr on Mon Dec 23, 2013 7:56 am

I'm trying to do the same thing. What was the command you used in the end, Daniel? for me so far it doesn't work.
Voaxeyr
 
Posts: 6
Joined: Wed Sep 25, 2013 6:00 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 36 guests