Blob Blame History Raw
Red Hat bugzilla sets the default limit to 20

This is terribly small number for a random use-case.  Let's configure the
default on client-side to the maximal 1000 (users can provide their own default
in ~/.bugzrc).

Anyways, the --limit/--offset options are already implemented.


diff --git a/bugz/cli.py b/bugz/cli.py
index 94842f2..03ca31f 100644
--- a/bugz/cli.py
+++ b/bugz/cli.py
@@ -625,6 +625,10 @@ the keywords given on the title (or the body if specified).
 
 	search_term = ' '.join(conn.terms).strip()
 
+	def_limit = getattr(conn, "default_limit", None)
+	if def_limit and "limit" not in params:
+		params["limit"] = def_limit
+
 	if not (params or search_term):
 		raise BugzError('Please give search terms or options.')
 
diff --git a/bugz/connection.py b/bugz/connection.py
index bdf5734..aaa5e04 100644
--- a/bugz/connection.py
+++ b/bugz/connection.py
@@ -57,6 +57,11 @@ class Connection:
 				self.password = get_config_option(config.get,
 					self.connection, 'password')
 
+		if not hasattr(self, 'default_limit'):
+			if config.has_option(self.connection, 'default_limit'):
+				self.default_limit = get_config_option(config.get,
+					self.connection, 'default_limit')
+
 		if not hasattr(self, 'passwordcmd'):
 			if config.has_option(self.connection, 'passwordcmd'):
 				self.passwordcmd = get_config_option(config.get,
diff --git a/pybugz.d/redhat.conf b/pybugz.d/redhat.conf
index 66c6281..b27d004 100644
--- a/pybugz.d/redhat.conf
+++ b/pybugz.d/redhat.conf
@@ -1,3 +1,4 @@
 [RedHat]
 base = https://bugzilla.redhat.com/xmlrpc.cgi
 search_statuses = NEW ASSIGNED MODIFIED ON_DEV POST
+default_limit = 1000