Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# InputArgs
A sublime text plugin to send custom input arguments when building using 'ctrl + b'. View a program output with custom arguments from within sublime text.

A sublime text plugin to send custom input arguments when building using 'ctrl + b'. View a program output with custom arguments from within sublime text (see http://stackoverflow.com/questions/16490889/build-and-run-with-arguments-in-sublime-text-2 for discussion and alternatives).

##Installing

Expand Down Expand Up @@ -34,4 +33,17 @@ Standard sublime text build system commands.

Use "ctrl+b" to run the build system and an input dialog will ask for arguments.

New Build Systems can be added through "Tools>Build System>New Build System".
New build systems can be added through "Tools>Build System>New Build System".

If you'd rather not override your build system and instead would prefer to customize it, you can use the `target` option and change the name of the plugin command from `ExecCommand`; e.g., `InputArgsCommand` would match the target option `input_args` as shown in the below example:

### Example build system
```
{
"shell_cmd" : ["make $file_base_name && ./$file_base_name"],
"selector" : "source.c",
"shell": true,
"target": "input_args",
"working_dir" : "$file_path",
}
```
5 changes: 3 additions & 2 deletions exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def run(self, cmd = None, shell_cmd = None, file_regex = "", line_regex = "", wo
word_wrap = True, syntax = "Packages/Text/Plain text.tmLanguage",
# Catches "path" and "shell"
**kwargs):
self.sl = kwargs

shell_cmd = ''.join(shell_cmd)
# clear the text_queue
self.text_queue_lock.acquire()
self.truth = False
Expand Down Expand Up @@ -241,7 +242,7 @@ def fun(self, cmd, shell_cmd, merged_env, ss):
try:
# Forward kwargs to AsyncProcess

self.proc = AsyncProcess(cmd, shell_cmd, merged_env, self, self.sl)
self.proc = AsyncProcess(cmd, shell_cmd, merged_env, self)

self.text_queue_lock.acquire()
try:
Expand Down