#3910 Fix a few CLI help messages
Opened 2 years ago by edsantos. Modified a year ago
edsantos/koji fix-cli-help-messages  into  master

file modified
+3 -3
@@ -5242,7 +5242,7 @@ 

  

  def handle_remove_tag_inheritance(goptions, session, args):

      """[admin] Remove a tag inheritance link"""

-     usage = "usage: %prog remove-tag-inheritance <tag> <parent> <priority>"

+     usage = "usage: %prog remove-tag-inheritance <tag> <parent>"

It should be:

usage = "usage: %prog remove-tag-inheritance <tag> <parent> [<priority>]"

      parser = OptionParser(usage=get_usage_str(usage))

      (options, args) = parser.parse_args(args)

  
@@ -6531,7 +6531,7 @@ 

  

  def handle_tag_build(opts, session, args):

      "[bind] Apply a tag to one or more builds"

-     usage = "usage: %prog tag-build [options] <tag> <pkg> [<pkg> ...]"

+     usage = "usage: %prog tag-build [options] <tag> <n-v-r> [<n-v-r> ...]"

      parser = OptionParser(usage=get_usage_str(usage))

      parser.add_option("--force", action="store_true", help="force operation")

      parser.add_option("--wait", action="store_true",
@@ -6609,7 +6609,7 @@ 

  

  def handle_untag_build(goptions, session, args):

      "[bind] Remove a tag from one or more builds"

-     usage = "usage: %prog untag-build [options] <tag> <pkg> [<pkg> ...]"

+     usage = "usage: %prog untag-build [options] <tag> <n-v-r> [<n-v-r> ...]"

      parser = OptionParser(usage=get_usage_str(usage))

      parser.add_option("--all", action="store_true",

                        help="untag all versions of the package in this tag, pkg is package name")

  • remove-build-inheritance: when the priority is passed as a positional
    parameter, no inheritance is ever found.
  • (un)tag-build: the last repeatable positional parameter can be a build
    with name, version, and release, and not just the name of a package.

It should be:

usage = "usage: %prog remove-tag-inheritance <tag> <parent> [<priority>]"

It should be:
usage = "usage: %prog remove-tag-inheritance <tag> <parent> [<priority>]"

Whenever I pass <priority> as a positional argument, Koji seems to never be able to find the inheritance. More importantly: can a given tag inherit from the same another tag with more than one priority?

Ah, bug is present there :-) args[2] needs to be converted to int - then it works.
For second question - not now, but it is a regression and #2804 should fix this.

For second question - not now, but it is a regression and #2804 should fix this.

Inability to directly inherit from the same parent twice is not a regression. The db constraint has always prevented this.

We don't have to address #2804 in order to handle the priority arg correctly here, though the arg is essentially pointless right now. That said, it might make sense to combine the fixes into one PR

Metadata