Navigation Menu

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

list allows usage of -l w/o -s while get doesn't #4

Closed
ljrk0 opened this issue May 10, 2022 · 4 comments
Closed

list allows usage of -l w/o -s while get doesn't #4

ljrk0 opened this issue May 10, 2022 · 4 comments

Comments

@ljrk0
Copy link

ljrk0 commented May 10, 2022

The list command implicitly allows using no selector and uses the default of "". Get doesn't work when only passing -l, nor does it work with passing -s "". In my case the "default" selector that get uses works quite well, but simply spits out a few chapters at the end that I intend to omit. Using papeer list -l 5 <uri> does that, however I cannot do the same with papeer get -l 5 <uri>.

I think ideally it should be allowed to use -l and others with a default selector.

@lapwat
Copy link
Owner

lapwat commented May 10, 2022

get and list options do not work exactly the same.

list option implicitly search for one level down.

On the other side, get option will retrieve the root page and will not look for subpages. You need to specify at least a --depth or --selector as the error message suggests:

> papeer get -l2 https://blog.lapw.at
cannot use limit option if depth/selector is not specified

In your case, where you want the selector to be automatically determined, you may use a the depth option set to 1.

> papeer get -d1 -l2 https://blog.lapw.at
Markdown saved to "lapw.at's_blog.md"

https://github.com/lapwat/papeer#depth-option

Hope it helps

@lapwat
Copy link
Owner

lapwat commented May 10, 2022

However, it could be a nice feature to add. When you specify a limit option, it is also implicit that you want to look for one level down.

@lapwat
Copy link
Owner

lapwat commented May 10, 2022

I took the opportunity to add the feature you requested in this issue in release 0.5.4.

Now both commands should be accepted and have the same behavior:

papeer get -d1 -l2 https://blog.lapw.at
papeer get -l2 https://blog.lapw.at

@lapwat lapwat closed this as completed May 10, 2022
@ljrk0
Copy link
Author

ljrk0 commented May 12, 2022

Wow, now I understand both the original issue better and it's already fixed! I'm more than grateful, what a wonderful tool!

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

No branches or pull requests

2 participants