Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add download options and position from cli #93

Merged
merged 3 commits into from
Apr 9, 2021

Conversation

jonnieey
Copy link
Contributor

@jonnieey jonnieey commented Apr 5, 2021

No description provided.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Issue pawamoy#33
@jonnieey jonnieey closed this Apr 5, 2021
@jonnieey jonnieey reopened this Apr 5, 2021
@jonnieey jonnieey changed the title feat: Add download options and position from cli. Issue #33 Add download options and position from cli Apr 5, 2021
Copy link
Owner

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

A bit of logic to improve 😛

Also, maybe you could add the same CLI options for the other add commands, like add-magnet, add-torrent and add-metalink?

src/aria2p/cli.py Outdated Show resolved Hide resolved
src/aria2p/cli.py Outdated Show resolved Hide resolved
src/aria2p/api.py Outdated Show resolved Hide resolved
src/aria2p/cli.py Outdated Show resolved Hide resolved
src/aria2p/cli.py Outdated Show resolved Hide resolved
src/aria2p/cli.py Outdated Show resolved Hide resolved
src/aria2p/cli.py Outdated Show resolved Hide resolved

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@jonnieey
Copy link
Contributor Author

jonnieey commented Apr 8, 2021 via email

@pawamoy
Copy link
Owner

pawamoy commented Apr 8, 2021

Thanks for the update 🙂

I couldn't understand this part. "Using the function as type in the argparse option".

When you define an option with argparse, you can set the type parameter to a callable that transforms the string passed from the command line into something else, and raises a ArgumentParserError if the value is invalid.
https://docs.python.org/3/library/argparse.html#type

The PR is already nice like that, you don't have to change it 🙂
As always, we should add tests for the changes, but I can take care of it in another PR.

@jonnieey
Copy link
Contributor Author

jonnieey commented Apr 8, 2021 via email

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Owner

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored a bit and added tests.

@pawamoy pawamoy merged commit 3ec3673 into pawamoy:master Apr 9, 2021
@pawamoy
Copy link
Owner

pawamoy commented Apr 9, 2021

Thanks again for your contribution @jonnieey!

@jonnieey
Copy link
Contributor Author

jonnieey commented Apr 9, 2021

👍 Cheers.

@jonnieey jonnieey deleted the add-download-options-cli branch June 30, 2021 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants