Clean up docs/help for install and remote-add

This makes it easier how the different variants like --from and --bundle
work.

Fixes https://github.com/flatpak/flatpak/issues/438 and
https://github.com/flatpak/flatpak/issues/439
This commit is contained in:
Alexander Larsson
2016-12-13 11:18:16 +01:00
parent 057fbcb459
commit f6d1a064b9
4 changed files with 65 additions and 39 deletions

View File

@@ -59,9 +59,9 @@ static GOptionEntry options[] = {
{ "no-deps", 0, 0, G_OPTION_ARG_NONE, &opt_no_deps, N_("Don't verify/install runtime dependencies"), NULL },
{ "runtime", 0, 0, G_OPTION_ARG_NONE, &opt_runtime, N_("Look for runtime with the specified name"), NULL },
{ "app", 0, 0, G_OPTION_ARG_NONE, &opt_app, N_("Look for app with the specified name"), NULL },
{ "bundle", 0, 0, G_OPTION_ARG_NONE, &opt_bundle, N_("Install from local bundle file"), NULL },
{ "from", 0, 0, G_OPTION_ARG_NONE, &opt_from, N_("Load options from file or uri"), NULL },
{ "oci", 0, 0, G_OPTION_ARG_NONE, &opt_oci, N_("Install from oci image"), NULL },
{ "bundle", 0, 0, G_OPTION_ARG_NONE, &opt_bundle, N_("Assume LOCATION is a .flatpak single-file bundle"), NULL },
{ "from", 0, 0, G_OPTION_ARG_NONE, &opt_from, N_("Assume LOCATION is a .flatpakref application description"), NULL },
{ "oci", 0, 0, G_OPTION_ARG_NONE, &opt_oci, N_("Assume LOCATION is an oci registry"), NULL },
{ "gpg-file", 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &opt_gpg_file, N_("Check bundle signatures with GPG key from FILE (- for stdin)"), N_("FILE") },
{ "subpath", 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &opt_subpaths, N_("Only install this subpath"), N_("PATH") },
{ NULL }
@@ -366,7 +366,7 @@ flatpak_builtin_install (int argc, char **argv, GCancellable *cancellable, GErro
FlatpakKinds kinds;
g_autoptr(FlatpakTransaction) transaction = NULL;
context = g_option_context_new (_("REMOTE REF... - Install applications or runtimes"));
context = g_option_context_new (_("LOCATION/REMOTE [REF...] - Install applications or runtimes"));
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
if (!flatpak_option_context_parse (context, options, &argc, &argv, 0, &dir, cancellable, error))

View File

@@ -55,7 +55,7 @@ typedef struct
static FlatpakCommand commands[] = {
/* translators: please keep the leading space */
{ N_(" Manage installed apps and runtimes") },
{ "install", N_("Install an application or runtime from a remote"), flatpak_builtin_install, flatpak_complete_install },
{ "install", N_("Install an application or runtime"), flatpak_builtin_install, flatpak_complete_install },
{ "update", N_("Update an installed application or runtime"), flatpak_builtin_update, flatpak_complete_update },
{ "uninstall", N_("Uninstall an installed application or runtime"), flatpak_builtin_uninstall, flatpak_complete_uninstall },
{ "list", N_("List installed apps and/or runtimes"), flatpak_builtin_list, flatpak_complete_list },

View File

@@ -29,29 +29,33 @@
</refnamediv>
<refsynopsisdiv>
<para>Install from a configured remote:</para>
<cmdsynopsis>
<command>flatpak install</command>
<arg choice="opt" rep="repeat">OPTION</arg>
<arg choice="plain">REMOTE</arg>
<arg choice="plain">REMOTE-NAME</arg>
<arg choice="plain" rep="repeat">REF</arg>
</cmdsynopsis>
<para>Install from a .flatpakref file:</para>
<cmdsynopsis>
<command>flatpak install</command>
<arg choice="opt" rep="repeat">OPTION</arg>
<group choice="opt">
<arg choice="plain">--bundle</arg>
<arg choice="plain">--from</arg>
</group>
<arg choice="opt">--from</arg>
<arg choice="plain">LOCATION</arg>
</cmdsynopsis>
<para>Install from a .flatpak bundle:</para>
<cmdsynopsis>
<command>flatpak install</command>
<arg choice="opt" rep="repeat">OPTION</arg>
<arg choice="opt">--bundle</arg>
<arg choice="plain">FILENAME</arg>
</cmdsynopsis>
<para>Install from an OCI registry:</para>
<cmdsynopsis>
<command>flatpak install --oci</command>
<command>flatpak install</command>
<arg choice="opt" rep="repeat">OPTION</arg>
<group choice="opt">
<arg choice="plain">--bundle</arg>
<arg choice="plain">--from</arg>
</group>
<arg choice="plain">REGISTRYURI</arg>
<arg choice="plain">--oci</arg>
<arg choice="plain">LOCATION</arg>
<arg choice="opt">TAG</arg>
</cmdsynopsis>
</refsynopsisdiv>
@@ -60,12 +64,13 @@
<title>Description</title>
<para>
Installs an application or runtime. <arg choice="plain">REMOTE</arg> must name
an existing remote and <arg choice="plain">REF</arg> is a reference to the
application or runtime to install.
Installs an application or runtime. The primary way to
install is to specify a <arg>REMOTE</arg>
name as the source and one ore more <arg>REF</arg>s to specify the
application or runtime to install.
</para>
<para>
Each <arg choice="plain">REF</arg> arguments is a full or partial indentifier in the
Each <arg choice="plain">REF</arg> argument is a full or partial indentifier in the
flatpak ref format, which looks like "(app|runtime)/ID/ARCH/BRANCH". All elements
except ID are optional and can be left out, including the slashes,
so most of the time you need only specify ID. Any part left out will be matched
@@ -77,6 +82,14 @@
the specified <arg choice="plain">REMOTE</arg>, but you can limit this by using the --app or
--runtime option, or by supplying the initial element in the REF.
</para>
<para>
The alternative form of the command (<arg>--from</arg>,
<arg>--bundle</arg> or <arg>--oci</arg>) allows you to
install directly from a source such as a .flatpak
single-file bundle, a .flatpakref app description or an
OCI registry. The options are optional if the first
argument have the right extension.
</para>
<para>
Note that flatpak allows one to have multiple branches of an application and runtimes
installed and used at the same time. However, only version of an application one can be current,
@@ -88,12 +101,6 @@
Unless overridden with the --user option, this command creates a
system-wide installation.
</para>
<para>
The alternative form of the command installs an application from a
single-file bundle or a flatpakref file instead of a configured remote.
Bundles can be created with the flatpak build-bundle command, flatpakref
files are simple references to a remote repo for an application.
</para>
</refsect1>
@@ -116,8 +123,8 @@
<term><option>--bundle</option></term>
<listitem><para>
Install from a bundle file instead
of a configured remote.
Assume LOCATION is a .flatpak single-bundle file.
This is optional if the arguments ends with .flatpak.
</para></listitem>
</varlistentry>
@@ -125,8 +132,8 @@
<term><option>--from</option></term>
<listitem><para>
Install from a flatpakref file instead
of a configured remote.
Assume LOCATION is a .flatpakref file containing the details of the app to be installed.
This is optional if the arguments ends with .flatpakref.
</para></listitem>
</varlistentry>
@@ -249,7 +256,13 @@
<title>Examples</title>
<para>
<command>$ flatpak --user install test-repo org.gnome.GEdit</command>
<command>$ flatpak -install gnome org.gnome.gedit2</command>
</para>
<para>
<command>$ flatpak --user install gnome org.gnome.gedit//3.22</command>
</para>
<para>
<command>$ flatpak --user install https://sdk.gnome.org/gedit.flatpakref</command>
</para>
</refsect1>

View File

@@ -29,6 +29,15 @@
</refnamediv>
<refsynopsisdiv>
<para>Add from a .flatpakrepo file:</para>
<cmdsynopsis>
<command>flatpak remote-add</command>
<arg choice="opt" rep="repeat">OPTION</arg>
<arg choice="opt">--from</arg>
<arg choice="plain">NAME</arg>
<arg choice="plain">LOCATION</arg>
</cmdsynopsis>
<para>Manually specify repo uri and options:</para>
<cmdsynopsis>
<command>flatpak remote-add</command>
<arg choice="opt" rep="repeat">OPTION</arg>
@@ -41,18 +50,18 @@
<title>Description</title>
<para>
Adds a remote repository to the flatpak repository configuration.
<arg choice="plain">NAME</arg> is the name for the new remote, and
<arg choice="plain">LOCATION</arg> is the url or pathname for the repository.
Adds a remote repository to the flatpak repository
configuration. <arg>NAME</arg> is the name for the new
remote, and <arg>LOCATION</arg> is a url or pathname. The
<arg>LOCATION</arg> is either a flatpak repository, or a
.flatpakrepo file which describes a repository. In the
former case you may also have to specify extra options,
such as the gpg key for the repo.
</para>
<para>
Unless overridden with the --user option, this command changes
the system-wide configuration.
</para>
<para>
The alternative form of the command adds a remote from a flatpakrepo
file.
</para>
</refsect1>
@@ -75,7 +84,8 @@
<term><option>--from</option></term>
<listitem><para>
Add from a flatpakrepo file (local or http uri) instead of from commandline arguments. This means the LOCATION argument specifies the filename/uri of a flatpakref rather than a repo url.
Assume the URI is a .flatpakrepo file rather than the repository itself. This is enabled
by default if the extension is .flatpakrepo, so generally you don't need this option.
</para></listitem>
</varlistentry>
@@ -203,6 +213,9 @@
<refsect1>
<title>Examples</title>
<para>
<command>$ flatpak remote-add gnome https://sdk.gnome.org/gnome.flatpakrepo</command>
</para>
<para>
<command>$ flatpak --user remote-add --no-gpg-verify test-repo https://people.gnome.org/~alexl/gnome-sdk/repo/</command>
</para>