I tried to remove a directory without -r and I got this error:
user@vpn-ssh:~/git$ rm foo
Traceback (most recent call last):
File "/home/user/venv-resrm/bin/resrm", line 8, in <module>
sys.exit(main())
~~~~^^
File "/home/user/venv-resrm/lib/python3.13/site-packages/resrm/core.py", line 435, in main
if args.f:
^^^^^^
AttributeError: 'Namespace' object has no attribute 'f'
It turns out that in argparse, if you have two flags for the same attribute (e.g -f and --force), argparse favours the 'longest' attribute name. So only args.force works, not args.f.
I tried to remove a directory without -r and I got this error:
```
user@vpn-ssh:~/git$ rm foo
Traceback (most recent call last):
File "/home/user/venv-resrm/bin/resrm", line 8, in <module>
sys.exit(main())
~~~~^^
File "/home/user/venv-resrm/lib/python3.13/site-packages/resrm/core.py", line 435, in main
if args.f:
^^^^^^
AttributeError: 'Namespace' object has no attribute 'f'
```
It turns out that in argparse, if you have two flags for the same attribute (e.g `-f` and `--force`), argparse favours the 'longest' attribute name. So only `args.force` works, not `args.f`.
mdaleo404
(Migrated from github.com)
approved these changes 2025-11-17 14:55:47 +00:00
mdaleo404
(Migrated from github.com)
left a comment
Copy Link
Copy Source
Yes, thank you! This was on my list of "To-Do" but it always lost priority.
Merging...
Yes, thank you! This was on my list of "To-Do" but it always lost priority.
Merging...
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I tried to remove a directory without -r and I got this error:
It turns out that in argparse, if you have two flags for the same attribute (e.g
-fand--force), argparse favours the 'longest' attribute name. So onlyargs.forceworks, notargs.f.Yes, thank you! This was on my list of "To-Do" but it always lost priority.
Merging...