nebius/SWE-bench-extra huggingface dataset:
Repository: pddg/uroboros

Issue:
`Command.get_options()` does not work well
### Expected

```python
class SomeOption(uroboros.Option):
    def build_option(self, parser):
        parser.add_argument('--opt', type=str)
        return parser

class HelloCommand(uroboros.Command):

    def get_options():
        return [SomeOption()]

HelloCommand().execute()
```

Now, `--opt` can be used.

### Actual

`--opt` does not be appeared in help message, and cannot parse it.



Comments:

Patch:
diff --git a/uroboros/command.py b/uroboros/command.py
index 1f15f8b..b32f61c 100644
--- a/uroboros/command.py
+++ b/uroboros/command.py
@@ -121,7 +121,7 @@ class Command(metaclass=abc.ABCMeta):
                 name=cmd.name,
                 description=cmd.long_description,
                 help=cmd.short_description,
-                parents=[o.get_parser() for o in cmd.options],
+                parents=[o.get_parser() for o in cmd.get_options()],
             )
             cmd.initialize(sub_parser)
 
@@ -129,7 +129,7 @@ class Command(metaclass=abc.ABCMeta):
         parser = argparse.ArgumentParser(
             prog=self.name,
             description=self.long_description,
-            parents=[o.get_parser() for o in self.options]
+            parents=[o.get_parser() for o in self.get_options()]
         )
         parser.set_defaults(func=self.run)
         return parser


Test patch:
diff --git a/tests/test_command.py b/tests/test_command.py
index b80b64f..a7eb5f0 100644
--- a/tests/test_command.py
+++ b/tests/test_command.py
@@ -4,6 +4,7 @@ from unittest import mock
 
 import pytest
 
+from uroboros import Option
 from uroboros.errors import CommandDuplicateError
 from .base import RootCommand, SecondCommand, ThirdCommand
 
@@ -318,3 +319,22 @@ class TestCommand(object):
         for cmd in commands:
             key = "after_validate_{}".format(cmd.name)
             assert getattr(args, key, None) == cmd.value
+
+    def test_create_default_parser(self):
+        class Opt(Option):
+            def build_option(self, parser):
+                parser.add_argument("--test", type=str)
+                return parser
+
+        class Cmd(RootCommand):
+            options = [Opt()]
+
+        class Cmd2(RootCommand):
+            def get_options(self):
+                return [Opt()]
+
+        argv = ["--test", "test"]
+        for cmd in [Cmd(), Cmd2()]:
+            cmd_parser = cmd.create_default_parser()
+            args = cmd_parser.parse_args(argv)
+            assert args.test == 'test'
Repository: pddg/uroboros

Issue:
Use `return` not `raise` in Option.validate
If the validate function is not overwritten, it rases following exception.
```sh
Traceback (most recent call last):
  File "examples/main.py", line 310, in <module>
    exit_code = root_cmd.execute()
  File "/home/pudding/.local/share/virtualenvs/hoger-EWaBsfe_/lib/python3.7/site-packages/uroboros/command.py", line 67, in execute
    exceptions = self._validate_all(args, commands)
  File "/home/pudding/.local/share/virtualenvs/hoge-EWaBsfe_/lib/python3.7/site-packages/uroboros/command.py", line 281, in _validate_all
    exceptions.extend(cmd.validate(args))
  File "/home/pudding/.local/share/virtualenvs/hoge-EWaBsfe_/lib/python3.7/site-packages/uroboros/command.py", line 292, in validate
    exceptions.extend(opt.validate(args))
  File "/home/pudding/.local/share/virtualenvs/hoge-EWaBsfe_/lib/python3.7/site-packages/uroboros/option.py", line 30, in validate
    raise []
TypeError: exceptions must derive from BaseException
```

Comments:

Patch:
diff --git a/uroboros/option.py b/uroboros/option.py
index 03975ff..65bf35f 100644
--- a/uroboros/option.py
+++ b/uroboros/option.py
@@ -27,7 +27,7 @@ class Option(metaclass=abc.ABCMeta):
         return unsafe_args
 
     def validate(self, args: 'argparse.Namespace') -> 'List[Exception]':
-        raise []
+        return []
 
     def after_validate(self,
                        safe_args: 'argparse.Namespace'


Test patch:
diff --git a/tests/test_option.py b/tests/test_option.py
index 67b0751..00e2a24 100644
--- a/tests/test_option.py
+++ b/tests/test_option.py
@@ -57,6 +57,13 @@ class NoHookOption(uroboros.Option):
 
 class TestOption(object):
 
+    def test_validate(self):
+        args = argparse.Namespace()
+        nohook = NoHookOption()
+        actual = nohook.validate(args)
+        assert type(actual) == list
+        assert len(actual) == 0
+
     def test_no_before_validate(self):
         args = argparse.Namespace()
         nohook = NoHookOption()