<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<refentry id="switcherooctl">
  <refentryinfo>
    <title>switcherooctl</title>
    <productname>switcherooctl</productname>
    <authorgroup>
      <author>
        <contrib>Developer</contrib>
        <firstname>Bastien</firstname>
        <surname>Nocera</surname>
        <email>hadess@hadess.net</email>
      </author>
    </authorgroup>
  </refentryinfo>

  <refmeta>
    <refentrytitle>switcherooctl</refentrytitle>
    <manvolnum>1</manvolnum>
    <refmiscinfo class="manual">User Commands</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname>switcherooctl</refname>
    <refpurpose>Launch a command on a specific GPU</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>switcherooctl</command>
      <arg choice="plain">help</arg>
      <arg choice="opt"><replaceable>COMMAND</replaceable></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>switcherooctl</command>
      <arg choice="plain">version</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>switcherooctl</command>
      <arg choice="plain">list</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>switcherooctl</command>
      <arg choice="plain">launch</arg>
      <arg choice="opt"><replaceable>OPTION</replaceable></arg>
      <arg choice="plain" rep="repeat"><replaceable>COMMAND</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Description</title>
    <para><command>switcherooctl</command> is a utility to launch a specific
    command on a specific GPU.</para>
  </refsect1>

  <refsect1>
    <title>Commands</title>

    <variablelist>
      <varlistentry>
        <term>
          <command>help</command>
          <arg choice="opt"><replaceable>COMMAND</replaceable></arg>
        </term>
        <listitem>
          <para>Displays a short synopsis of the available commands or provides
            detailed help on a specific command.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>
          <command>version</command>
        </term>
        <listitem>
          <para>Prints the switcheroo-control version to which <command>switcherooctl</command>
            belongs.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>
          <command>list</command>
        </term>
        <listitem>
        <para>List the known GPUs. The device number can be used to specify the GPU to
        launch on for the <literal>launch</literal> command. This is the default command
        if no commands are passed to <literal>switcherooctl</literal>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>
          <command>launch</command>
          <arg choice="opt"><replaceable>OPTION</replaceable></arg>
          <arg choice="plain" rep="repeat"><replaceable>COMMAND</replaceable></arg>
        </term>
        <listitem>
          <para>Launch <replaceable>COMMAND</replaceable> on a specific GPU. If no GPU are specified the first discrete
          (non-default) GPU is used, or the default GPU if there's no discrete GPU.</para>
          <refsect3>
            <title>Options</title>
            <variablelist>
              <varlistentry>
                <term><option>-g</option> <option>--gpu=<replaceable>GPU</replaceable></option></term>
                <listitem><para>The GPU to launch on. The GPU identifier can be gathered using the <literal>list</literal> command.</para></listitem>
              </varlistentry>
            </variablelist>
          </refsect3>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1>
    <title>Exit status</title>
    <para>On success 0 is returned, a non-zero failure code otherwise.</para>
  </refsect1>

</refentry>
