IdeApplicationTool: Builder SDK Reference

## IdeApplicationTool IdeApplicationTool — Implement command-line tools for Builder |

## Functions

void | ide_application_tool_run_async ()
gint | ide_application_tool_run_finish ()

## Types and Values

#define | IDE_TYPE_APPLICATION_TOOL
struct | IdeApplicationToolInterface
| IdeApplicationTool

## Object Hierarchy

        GInterface
        ╰── IdeApplicationTool

## Prerequisites

IdeApplicationTool requires GObject.

## Description

Builder supports running in "command-line" mode when executed like "gnome-builder -t cli". If you use Builder from flatpak, this may be activated like "flatpak run org.gnome.Builder -t cli".

We suggest users that want to use this feature often to alias the command in their shell such as "alias ide="gnome-builder -t cli".

When running Builder in this mode, a number of command line tools can be used instead of the full Gtk-based user interface.

Plugins can implement this interface to provide additional command-line tools. To be displayed in user help, you must also specify the name such as "X-Tool-Name=foo" in your plugin's .plugin manifest. You should also provide "X-Tool-Description=description" to notify the user of what the tool does.

## Functions

### ide_application_tool_run_async ()

    void
    ide_application_tool_run_async (IdeApplicationTool *self,
                                    const gchar * const *arguments,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Asynchronously runs an application tool. This is typically done on the command line using the `ide` command.

#### Parameters

self | An IdeApplicationTool |
arguments | argv for the command. | [array zero-terminated=1][element-type utf8]
cancellable | a GCancellable or `NULL`. | [nullable]
callback | A callback to execute upon completion |
user_data | User data for `callback` |

Since: 3.22

### ide_application_tool_run_finish ()

    gint
    ide_application_tool_run_finish (IdeApplicationTool *self,
                                     GAsyncResult *result,
                                     GError **error);

Completes an asynchronous request to `ide_application_tool_run_async()`. This should return an exit code (were 0 is success) and set `error` when non-zero.

The exit code shall be returned to the calling shell.

#### Parameters

self | a IdeApplicationTool |
result | a GAsyncResult |
error | a location for a GError or `NULL` |

#### Returns

A shell exit code, 0 for success, otherwise `error` is set.

Since: 3.22

## Types and Values

### IDE_TYPE_APPLICATION_TOOL

    #define IDE_TYPE_APPLICATION_TOOL (ide_application_tool_get_type())

### struct IdeApplicationToolInterface

    struct IdeApplicationToolInterface {
      GTypeInterface parent_interface;

      void (*run_async)  (IdeApplicationTool   *self,
                          const gchar * const  *arguments,
                          GCancellable         *cancellable,
                          GAsyncReadyCallback   callback,
                          gpointer              user_data);
      gint (*run_finish) (IdeApplicationTool   *self,
                          GAsyncResult         *result,
                          GError              **error);
    };

Use this interface to implement a command-line tool for Builder that can be accessed when running builder in command-line mode using "gnome-builder -t cli".

#### Members

GTypeInterface `parent_interface`; |  |
`run_async` () | You must implement this virtual function as part of running your command line operation. |
`run_finish` () | You must implement this virtual function as part of running your command line operation. |

Since: 3.22

### IdeApplicationTool

    typedef struct _IdeApplicationTool IdeApplicationTool;