diff --git a/antfs_cli/program.py b/antfs_cli/program.py index d24d3e1..086d30c 100755 --- a/antfs_cli/program.py +++ b/antfs_cli/program.py @@ -150,6 +150,7 @@ def __init__(self, config_dir, args): self._uploading = args.upload self._pair = args.pair self._skip_archived = args.skip_archived + self._oldest_first = args.oldest_first def setup_channel(self, channel): channel.set_period(4096) @@ -245,6 +246,9 @@ def on_transport(self, beacon): if self._skip_archived: downloading = [fil for fil in downloading if not fil.is_archived()] + if not self._oldest_first: + downloading = list(reversed(downloading)) + print("Downloading", len(downloading), "file(s)") if self._uploading: print(" and uploading", len(uploading), "file(s)") @@ -348,6 +352,11 @@ def main(): action="store_true", help="don't download files marked as 'archived' on the watch", ) + parser.add_argument( + "--oldest-first", + action="store_true", + help="download the oldest activities first", + ) args = parser.parse_args() # Set up config dir