aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/fiv.adoc4
-rw-r--r--fiv.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/docs/fiv.adoc b/docs/fiv.adoc
index 5285d5d..0188086 100644
--- a/docs/fiv.adoc
+++ b/docs/fiv.adoc
@@ -32,6 +32,10 @@ Options
handler to implement the "Open Containing Folder" feature of certain
applications.
+*--collection*::
+ Always put arguments in a virtual directory, even when only one is passed.
+ Implies *--browse*.
+
*--help-all*::
Show the full list of options, including those provided by GTK+.
diff --git a/fiv.c b/fiv.c
index 0b50f31..ad73537 100644
--- a/fiv.c
+++ b/fiv.c
@@ -2453,7 +2453,7 @@ on_app_startup(GApplication *app, G_GNUC_UNUSED gpointer user_data)
}
static struct {
- gboolean browse, extract_thumbnail;
+ gboolean browse, collection, extract_thumbnail;
gchar **args, *thumbnail_size, *thumbnail_size_search;
} o;
@@ -2463,12 +2463,12 @@ on_app_activate(
{
// XXX: We follow the behaviour of Firefox and Eye of GNOME, which both
// interpret multiple command line arguments differently, as a collection.
- // However, single-element collections are unrepresentable this way.
- // Should we allow multiple targets only in a special new mode?
+ // However, single-element collections are unrepresentable this way,
+ // so we have a switch to enforce it.
g.files_index = -1;
if (o.args) {
const gchar *target = *o.args;
- if (o.args[1]) {
+ if (o.args[1] || o.collection) {
fiv_collection_reload(o.args);
target = FIV_COLLECTION_SCHEME ":/";
}
@@ -2619,6 +2619,9 @@ main(int argc, char *argv[])
{"browse", 0, G_OPTION_FLAG_IN_MAIN,
G_OPTION_ARG_NONE, &o.browse,
"Start in filesystem browsing mode", NULL},
+ {"collection", 0, G_OPTION_FLAG_IN_MAIN,
+ G_OPTION_ARG_NONE, &o.collection,
+ "Always put arguments in a collection (implies --browse)", NULL},
{"invalidate-cache", 0, G_OPTION_FLAG_IN_MAIN,
G_OPTION_ARG_NONE, NULL,
"Invalidate the wide thumbnail cache", NULL},