app: Fix various CLI metavariable names
authorJonathan Lebon <jonathan@jlebon.com>
Thu, 30 Jul 2020 21:35:20 +0000 (17:35 -0400)
committerJonathan Lebon <jonathan@jlebon.com>
Fri, 31 Jul 2020 19:02:47 +0000 (15:02 -0400)
- Use `REV` instead of `REF` in places where we meant it.
- Fix `commit --parent` actually taking a commit checksum and not a ref.
- Fix `ostree admin switch` using `REF` instead of `REFSPEC`.

src/ostree/ot-admin-builtin-switch.c
src/ostree/ot-builtin-admin.c
src/ostree/ot-builtin-commit.c
src/ostree/ot-builtin-log.c

index 2f12ef1d7111d4c1b35dc0ead478dce5828b9d5e..b94be767ea734f7221ca65399bfcf853fa1a81a9 100644 (file)
@@ -44,7 +44,7 @@ gboolean
 ot_admin_builtin_switch (int argc, char **argv, OstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error)
 {
   g_autoptr(GOptionContext) context =
-    g_option_context_new ("REF");
+    g_option_context_new ("REFSPEC");
   g_autoptr(OstreeSysroot) sysroot = NULL;
   if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
                                           OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER,
@@ -53,7 +53,7 @@ ot_admin_builtin_switch (int argc, char **argv, OstreeCommandInvocation *invocat
 
   if (argc < 2)
     {
-      ot_util_usage_error (context, "REF must be specified", error);
+      ot_util_usage_error (context, "REFSPEC must be specified", error);
       return FALSE;
     }
 
index 9f1a61562a8234bd49a2e116cfcede0944f59ef9..834a271bb43c93ca5aca159d76c4f941010e1abc 100644 (file)
@@ -65,7 +65,7 @@ static OstreeCommand admin_subcommands[] = {
     "List deployments" },
   { "switch", OSTREE_BUILTIN_FLAG_NO_REPO,
     ot_admin_builtin_switch,
-    "Construct new tree from REF and deploy it" },
+    "Construct new tree from REFSPEC and deploy it" },
   { "undeploy", OSTREE_BUILTIN_FLAG_NO_REPO,
     ot_admin_builtin_undeploy,
     "Delete deployment INDEX" },
index 20409fc2130c2634efd66330338b86deb53800f5..e2fcf1036f5eb35d100029cebdaa4e03851e521f 100644 (file)
@@ -94,7 +94,7 @@ parse_fsync_cb (const char  *option_name,
  */
 
 static GOptionEntry options[] = {
-  { "parent", 0, 0, G_OPTION_ARG_STRING, &opt_parent, "Parent ref, or \"none\"", "REF" },
+  { "parent", 0, 0, G_OPTION_ARG_STRING, &opt_parent, "Parent commit checksum, or \"none\"", "COMMIT" },
   { "subject", 's', 0, G_OPTION_ARG_STRING, &opt_subject, "One line subject", "SUBJECT" },
   { "body", 'm', 0, G_OPTION_ARG_STRING, &opt_body, "Full description", "BODY" },
   { "body-file", 'F', 0, G_OPTION_ARG_FILENAME, &opt_body_file, "Commit message from FILE path", "FILE" },
@@ -103,7 +103,7 @@ static GOptionEntry options[] = {
   { "orphan", 0, 0, G_OPTION_ARG_NONE, &opt_orphan, "Create a commit without writing a ref", NULL },
   { "no-bindings", 0, 0, G_OPTION_ARG_NONE, &opt_no_bindings, "Do not write any ref bindings", NULL },
   { "bind-ref", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_bind_refs, "Add a ref to ref binding commit metadata", "BRANCH" },
-  { "base", 0, 0, G_OPTION_ARG_STRING, &opt_base, "Start from the given commit as a base (no modifiers apply)", "REF" },
+  { "base", 0, 0, G_OPTION_ARG_STRING, &opt_base, "Start from the given commit as a base (no modifiers apply)", "REV" },
   { "tree", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_trees, "Overlay the given argument as a tree", "dir=PATH or tar=TARFILE or ref=COMMIT" },
   { "add-metadata-string", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_metadata_strings, "Add a key/value pair to metadata", "KEY=VALUE" },
   { "add-metadata", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_metadata_variants, "Add a key/value pair to metadata, where the KEY is a string, an VALUE is g_variant_parse() formatted", "KEY=VALUE" },
index 306f177b09b6b22d5a87b08ef35db1b1fbb2fdf9..0a1d408b45920e8e6b151971e14b24092f49d3e3 100644 (file)
@@ -95,7 +95,7 @@ ostree_builtin_log (int           argc,
   g_autofree char *checksum = NULL;
   OstreeDumpFlags flags = OSTREE_DUMP_NONE;
 
-  context = g_option_context_new ("REF");
+  context = g_option_context_new ("REV");
 
   if (!ostree_option_context_parse (context, options, &argc, &argv, invocation, &repo, cancellable, error))
     goto out;
@@ -105,7 +105,7 @@ ostree_builtin_log (int           argc,
 
   if (argc <= 1)
     {
-      ot_util_usage_error (context, "A ref argument is required", error);
+      ot_util_usage_error (context, "A rev argument is required", error);
       goto out;
     }
   rev = argv[1];