21e5954
Red Hat bugzilla sets the default limit to 20
21e5954
21e5954
This is terribly small number for a random use-case.  Let's configure the
21e5954
default on client-side to the maximal 1000 (users can provide their own default
21e5954
in ~/.bugzrc).
21e5954
21e5954
Anyways, the --limit/--offset options are already implemented.
21e5954
21e5954
21e5954
diff --git a/bugz/cli.py b/bugz/cli.py
21e5954
index 94842f2..03ca31f 100644
21e5954
--- a/bugz/cli.py
21e5954
+++ b/bugz/cli.py
21e5954
@@ -625,6 +625,10 @@ the keywords given on the title (or the body if specified).
21e5954
 
21e5954
 	search_term = ' '.join(conn.terms).strip()
21e5954
 
21e5954
+	def_limit = getattr(conn, "default_limit", None)
21e5954
+	if def_limit and "limit" not in params:
21e5954
+		params["limit"] = def_limit
21e5954
+
21e5954
 	if not (params or search_term):
21e5954
 		raise BugzError('Please give search terms or options.')
21e5954
 
21e5954
diff --git a/bugz/connection.py b/bugz/connection.py
21e5954
index bdf5734..aaa5e04 100644
21e5954
--- a/bugz/connection.py
21e5954
+++ b/bugz/connection.py
21e5954
@@ -57,6 +57,11 @@ class Connection:
21e5954
 				self.password = get_config_option(config.get,
21e5954
 					self.connection, 'password')
21e5954
 
21e5954
+		if not hasattr(self, 'default_limit'):
21e5954
+			if config.has_option(self.connection, 'default_limit'):
21e5954
+				self.default_limit = get_config_option(config.get,
21e5954
+					self.connection, 'default_limit')
21e5954
+
21e5954
 		if not hasattr(self, 'passwordcmd'):
21e5954
 			if config.has_option(self.connection, 'passwordcmd'):
21e5954
 				self.passwordcmd = get_config_option(config.get,
21e5954
diff --git a/pybugz.d/redhat.conf b/pybugz.d/redhat.conf
21e5954
index 66c6281..b27d004 100644
21e5954
--- a/pybugz.d/redhat.conf
21e5954
+++ b/pybugz.d/redhat.conf
21e5954
@@ -1,3 +1,4 @@
21e5954
 [RedHat]
21e5954
 base = https://bugzilla.redhat.com/xmlrpc.cgi
21e5954
 search_statuses = NEW ASSIGNED MODIFIED ON_DEV POST
21e5954
+default_limit = 1000