Update argument names and documentation for clarity in main.py and README.md

This commit is contained in:
Yunn Xairou 2025-09-13 21:36:12 +02:00
parent e31ae00528
commit 329b076caf
2 changed files with 29 additions and 5 deletions

26
main.py
View file

@ -30,7 +30,7 @@ class BookCollection(dict):
keys = expand_range(sequence) keys = expand_range(sequence)
for key in keys: for key in keys:
if not args.hors_series and not float(key).is_integer(): if not args.non_series and not float(key).is_integer():
continue continue
self.setdefault(key, []) self.setdefault(key, [])
self[key].append(book.asin) self[key].append(book.asin)
@ -189,7 +189,7 @@ def main():
except requests.exceptions.HTTPError: except requests.exceptions.HTTPError:
pass pass
if not found: if not found and args.oncoming:
soon_to_release_books.append(key) soon_to_release_books.append(key)
logger.debug( logger.debug(
"%s Book %d is yet to be released - %s", "%s Book %d is yet to be released - %s",
@ -216,9 +216,25 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("-d", "--dev", action="store_true") # General flags
parser.add_argument("-v", "--verbose", action="store_true") parser.add_argument(
parser.add_argument("--hors-series", action="store_true") "-v", "--verbose", action="store_true", help="Enable verbose logging"
)
parser.add_argument(
"-d", "--dev", action="store_true", help="Use development/mock connectors"
)
# Feature-specific flags
parser.add_argument(
"--non-series",
action="store_true",
help="Include non-series books (books not part of a numbered series)",
)
parser.add_argument(
"--oncoming",
action="store_true",
help="Show books to be released",
)
args = parser.parse_args() args = parser.parse_args()

View file

@ -32,6 +32,14 @@ python main.py
Logs are written to the `log` file. Logs are written to the `log` file.
### Feature-specific Arguments
- `--non-series`
Include non-series books (books not part of a numbered series).
- `--oncoming`
Show books that are yet to be released.
## Project Structure ## Project Structure
- [main.py](main.py): Entry point and main logic - [main.py](main.py): Entry point and main logic