diff --git a/CHANGELOG.md b/CHANGELOG.md
index 16cf30d..b325977 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
 and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
 
+## [Unreleased] - 2018-07-17
+
+### Fixed
+
+- Give proper error message when the `--number` argument is smaller than one. Fixes #164.
+
 ## [1.5.3] - 2018-07-14
 
 ### Fixed
diff --git a/README.md b/README.md
index ffb50ba..b489018 100644
--- a/README.md
+++ b/README.md
@@ -448,9 +448,9 @@ To run the unit tests:
 
 ```console
 $ python -m unittest
-............................................................................................................................................................................................................................................
+.............................................................................................................................................................................................................................................
 ----------------------------------------------------------------------
-Ran 236 tests in 2.931s
+Ran 237 tests in 2.303s
 
 OK
 ```
@@ -461,9 +461,9 @@ To create the unit test coverage report run the unit tests under coverage with:
 
 ```console
 $ coverage run --branch -m unittest
-............................................................................................................................................................................................................................................
+.............................................................................................................................................................................................................................................
 ----------------------------------------------------------------------
-Ran 236 tests in 3.557s
+Ran 237 tests in 3.159s
 
 OK
 ```
@@ -475,7 +475,7 @@ $ coverage report --fail-under=100 --omit=".venv/*" --skip-covered
 Name    Stmts   Miss Branch BrPart  Cover
 -----------------------------------------
 -----------------------------------------
-TOTAL    1347      0    173      0   100%
+TOTAL    1360      0    177      0   100%
 
 25 files skipped due to complete coverage.
 ```
diff --git a/next_action/arguments/parser.py b/next_action/arguments/parser.py
index 4d9df44..5d8c8ad 100644
--- a/next_action/arguments/parser.py
+++ b/next_action/arguments/parser.py
@@ -85,7 +85,7 @@ class NextActionArgumentParser(argparse.ArgumentParser):
             "-a", "--all", default=1, action="store_const", dest="number", const=sys.maxsize,
             help="show all next actions")
         number.add_argument(
-            "-n", "--number", metavar="<number>", type=int, default=1,
+            "-n", "--number", metavar="<number>", type=number_type, default=1,
             help="number of next actions to show (default: %(default)s)")
 
     def add_filter_arguments(self) -> None:
@@ -257,6 +257,17 @@ def date_type(value: str) -> datetime.date:
     raise argparse.ArgumentTypeError("invalid date: {0}".format(value))
 
 
+def number_type(value: str) -> int:
+    """Return the value if it's positive, else raise an error."""
+    try:
+        number = int(value)
+        if number > 0:
+            return number
+    except ValueError:
+        pass
+    raise argparse.ArgumentTypeError("invalid number: {0}".format(value))
+
+
 def subset(filters: List[str], prefix: str) -> Set[str]:
     """Return a subset of the filters based on prefix."""
     return set(f.strip(prefix) for f in filters if f.startswith(prefix))

Give error message when --number argument is a negative integer
diff --git a/tests/unittests/arguments/test_parser.py b/tests/unittests/arguments/test_parser.py
index fed6430..e606485 100644
--- a/tests/unittests/arguments/test_parser.py
+++ b/tests/unittests/arguments/test_parser.py
@@ -212,7 +212,16 @@ class NumberTest(ParserTestCase):
         """Test that the argument parser exits if the option is faulty."""
         self.assertRaises(SystemExit, parse_arguments)
         self.assertEqual([call(USAGE_MESSAGE),
-                          call("next-action: error: argument -n/--number: invalid int value: 'not_a_number'\n")],
+                          call("next-action: error: argument -n/--number: invalid number: not_a_number\n")],
+                         mock_stderr_write.call_args_list)
+
+    @patch.object(sys, "argv", ["next-action", "--number", "-1"])
+    @patch.object(sys.stderr, "write")
+    def test_negative_number(self, mock_stderr_write):
+        """Test that the argument parser exits if the option is faulty."""
+        self.assertRaises(SystemExit, parse_arguments)
+        self.assertEqual([call(USAGE_MESSAGE),
+                          call("next-action: error: argument -n/--number: invalid number: -1\n")],
                          mock_stderr_write.call_args_list)
 
     @patch.object(sys, "argv", ["next-action", "--all"])

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest coverage codacy-coverage pylint pydocstyle pycodestyle bandit mypy hypothesis
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
astroid==3.3.9
attrs==25.3.0
bandit==1.8.3
Cerberus==1.2
certifi==2025.1.31
charset-normalizer==3.4.1
codacy-coverage==1.3.11
coverage==7.8.0
dateparser==0.7.0
dill==0.3.9
exceptiongroup==1.2.2
hypothesis==6.130.5
idna==3.10
iniconfig==2.1.0
isort==6.0.1
markdown-it-py==3.0.0
mccabe==0.7.0
mdurl==0.1.2
mypy==1.15.0
mypy-extensions==1.0.0
-e git+https://github.com/fniessink/next-action.git@46f06f9138ef0ca532c7e7ecb281fbbc85880d46#egg=next_action
packaging==24.2
pbr==6.1.1
platformdirs==4.3.7
pluggy==1.5.0
pycodestyle==2.13.0
pydocstyle==6.3.0
Pygments==2.19.1
pylint==3.3.6
pytest==8.3.5
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.2
regex==2024.11.6
requests==2.32.3
rich==14.0.0
six==1.17.0
snowballstemmer==2.2.0
sortedcontainers==2.4.0
stevedore==5.4.1
tomli==2.2.1
tomlkit==0.13.2
typing_extensions==4.13.0
tzlocal==5.3.1
urllib3==2.3.0

name: next-action
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - astroid==3.3.9
      - attrs==25.3.0
      - bandit==1.8.3
      - cerberus==1.2
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - codacy-coverage==1.3.11
      - coverage==7.8.0
      - dateparser==0.7.0
      - dill==0.3.9
      - exceptiongroup==1.2.2
      - hypothesis==6.130.5
      - idna==3.10
      - iniconfig==2.1.0
      - isort==6.0.1
      - markdown-it-py==3.0.0
      - mccabe==0.7.0
      - mdurl==0.1.2
      - mypy==1.15.0
      - mypy-extensions==1.0.0
      - packaging==24.2
      - pbr==6.1.1
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pydocstyle==6.3.0
      - pygments==2.19.1
      - pylint==3.3.6
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==6.0.2
      - regex==2024.11.6
      - requests==2.32.3
      - rich==14.0.0
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sortedcontainers==2.4.0
      - stevedore==5.4.1
      - tomli==2.2.1
      - tomlkit==0.13.2
      - typing-extensions==4.13.0
      - tzlocal==5.3.1
      - urllib3==2.3.0
prefix: /opt/conda/envs/next-action

tests/unittests/arguments/test_parser.py::NumberTest::test_faulty_number tests/unittests/arguments/test_parser.py::NumberTest::test_negative_number
tests/unittests/arguments/test_parser.py::DueDateTest::test_due_date tests/unittests/arguments/test_parser.py::DueDateTest::test_invalid_date tests/unittests/arguments/test_parser.py::DueDateTest::test_too_long
tests/unittests/arguments/test_parser.py::NoArgumentTest::test_filename tests/unittests/arguments/test_parser.py::NoArgumentTest::test_filters tests/unittests/arguments/test_parser.py::NoArgumentTest::test_style tests/unittests/arguments/test_parser.py::FilenameTest::test_add_default_filename tests/unittests/arguments/test_parser.py::FilenameTest::test_add_filename_twice tests/unittests/arguments/test_parser.py::FilenameTest::test_default_and_non_default tests/unittests/arguments/test_parser.py::FilenameTest::test_filename_argument tests/unittests/arguments/test_parser.py::FilenameTest::test_home_folder_argument tests/unittests/arguments/test_parser.py::FilenameTest::test_long_filename_argument tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_contexts_and_projects tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_empty_context tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_empty_excluded_project tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_empty_project tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_exclude_context tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_exclude_project tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_faulty_option tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_include_exclude_context tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_include_exclude_project tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_invalid_extra_argument tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_multiple_contexts tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_multiple_projects tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_one_context tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_one_project tests/unittests/arguments/test_parser.py::FilterArgumentTest::test_project_after_excluded tests/unittests/arguments/test_parser.py::NumberTest::test_all_actions tests/unittests/arguments/test_parser.py::NumberTest::test_all_and_number tests/unittests/arguments/test_parser.py::NumberTest::test_default_number tests/unittests/arguments/test_parser.py::NumberTest::test_number tests/unittests/arguments/test_parser.py::DueDateTest::test_default tests/unittests/arguments/test_parser.py::DueDateTest::test_faulty_date tests/unittests/arguments/test_parser.py::DueDateTest::test_no_due_date tests/unittests/arguments/test_parser.py::ReferenceTest::test_always tests/unittests/arguments/test_parser.py::ReferenceTest::test_default tests/unittests/arguments/test_parser.py::ReferenceTest::test_faulty_date tests/unittests/arguments/test_parser.py::ReferenceTest::test_multiple tests/unittests/arguments/test_parser.py::ReferenceTest::test_never
next_action/arguments/parser.py README.md CHANGELOG.md
next_action/arguments/parser.py README.md CHANGELOG.md