code: func cmdListPackages(params Parameters) *subcommands.Command {
  	return &subcommands.Command{
  		UsageLine: "ls [-r] [<prefix string>]",
  		ShortDesc: "lists matching packages on the server",
  		LongDesc: "Queries the backend for a list of packages in the given path to " +
  			"which the user has access, optionally recursively.",
  		CommandRun: func() subcommands.CommandRun {
  			c := &listPackagesRun{}
  			c.registerBaseFlags()
  			c.clientOptions.registerFlags(&c.Flags, params, withoutRootDir)
  			c.Flags.BoolVar(&c.recursive, "r", false, "Whether to list packages in subdirectories.")
  			c.Flags.BoolVar(&c.showHidden, "h", false, "Whether also to list hidden packages.")
  			return c
  		},
  	}
  }
docs: ////////////////////////////////////////////////////////////////////////////////
  // 'ls' subcommand.