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 support for processing multiple input lines #78

Closed
uggyuggy opened this issue Aug 8, 2023 · 8 comments · Fixed by #110
Closed

Add support for processing multiple input lines #78

uggyuggy opened this issue Aug 8, 2023 · 8 comments · Fixed by #110
Assignees
Milestone

Comments

@uggyuggy
Copy link

uggyuggy commented Aug 8, 2023

Hi,

Thank's for sharing this tool.

Adding below few ideas/feature requests. As they are quite "close" and/or linked to each other (I think), I list those in a single "issue".

It would be nice to have an option for "direct" results without extra informations lines and/or that even could be the default ouput and the current output with some kind of -interactive

$ usl 'https://emea01.safelinks.protection.outlook.com/?url=http%xxxxxxxxx'
example.net

Current output could also be

$ usl -interactive

Enter URL: https://emea01.safelinks.protection.outlook.com/?url=http%xxxxx
Original URL: http://example.net

It would be nice to be able to be able to bulk process multiple links at once in parallel

  • From piped data
$ cat file.with.links | usl
http://example.com
http://example.net
  • From input file
$ usl -inputfile file.with.links
http://example.com
http://example.net
@atc0005 atc0005 self-assigned this Aug 8, 2023
@atc0005 atc0005 added enhancement New feature or request config labels Aug 8, 2023
@atc0005
Copy link
Owner

atc0005 commented Aug 8, 2023

@uggyuggy Thanks for filing this.

Will give this some thought and will ping you when there is something to test.

No estimates on timeline (other items have current focus).

@atc0005
Copy link
Owner

atc0005 commented Aug 9, 2023

Overall I like the ideas, but I'd like to keep the current behavior of prompting the user if no input is provided. When I had others test the tool this behavior seemed intuitive to them and did not require further explanation.

Based on that, I think this would be the result:

  • retain interactive prompt if no input given
  • emit results without leading explanation text (i.e., drop Original URL: text and following newline)
  • if input given, process and emit results without decoration until no further input provided (e.g., via pipe)
  • if input file given, process the same way as stdin

As I mentioned I have other items ahead of this, so would probably work on this in pieces.

@uggyuggy
Copy link
Author

uggyuggy commented Aug 9, 2023

Hi @atc0005

Thank's for sharing design plans.

I'd like to keep the current behavior of prompting the user if no input is provided.
...
retain interactive prompt if no input given

I fully understand you, you are right, that's probably better that way.

drop Original URL: text and following newline)

Yes, sending directly the result would be good, and should still makes perfect sense to any user.

if input given, process and emit results without decoration until no further input provided (e.g., via pipe)

Sounds good to me too.

if input file given, process the same way as stdin

Sounds good to me too.

As I mentioned I have other items ahead of this, so would probably work on this in pieces.

Thank's, feel free to ping me here so I could "help" testing further when you will work on this 👍

@atc0005 atc0005 added this to the v0.3.0 milestone Aug 22, 2023
atc0005 added a commit that referenced this issue Aug 22, 2023
- add support for reading input URLs from a file
- add support for reading input URLs from stdin
- retain interactive prompt if no input given
- remove leading explanation text from results
- emit URL parsing failure text to stderr, continue
  processing URLs
  - allow for batch operation
  - allow for splitting success results and error output
    across different files

refs GH-78
@atc0005
Copy link
Owner

atc0005 commented Aug 22, 2023

@uggyuggy Dev build available here:

No doc updates yet, but hopefully the help text covers new behavior well enough.

atc0005 added a commit that referenced this issue Aug 22, 2023
Split output and decoding logic to resolve gocognit linting
error.

refs GH-102
refs GH-78
@atc0005
Copy link
Owner

atc0005 commented Aug 22, 2023

@uggyuggy Dev build available here:

No doc updates yet, but hopefully the help text covers new behavior well enough.

Later dev build:

atc0005 added a commit that referenced this issue Aug 23, 2023
- add new support for processing standard input
- add new flags
- update examples

refs GH-78
@atc0005
Copy link
Owner

atc0005 commented Aug 23, 2023

No doc updates yet, but hopefully the help text covers new behavior well enough.

Updated README coverage:

atc0005 added a commit that referenced this issue Aug 25, 2023
- add support for reading input URLs from a file
- add support for reading input URLs from stdin
- retain interactive prompt if no input given
- remove leading explanation text from results
- emit URL parsing failure text to stderr, continue
  processing URLs
  - allow for batch operation
  - allow for splitting success results and error output
    across different files
- refactor output and decoding logic
- refresh README coverage
  - add new support for processing standard input
  - add new flags
  - update examples

refs GH-78
@atc0005 atc0005 changed the title Process multiples input lines Add support for processing multiple input lines Aug 25, 2023
@atc0005
Copy link
Owner

atc0005 commented Aug 25, 2023

Changes included in v0.3.0 release:

@uggyuggy
Copy link
Author

Hi @atc0005

Tested it, looks great.
Thank's 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants