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

--only/--quiet/… option for hyp create #43

Open
Treora opened this issue Apr 5, 2021 · 4 comments
Open

--only/--quiet/… option for hyp create #43

Treora opened this issue Apr 5, 2021 · 4 comments

Comments

@Treora
Copy link
Contributor

Treora commented Apr 5, 2021

For use in shell scripts or to pipe hyp’s output into other commands, it would be practical to have an option to only get the address of the created drive/bee from hyp create. Example output, currently:

> hyp create drive
Drive Created: hyper://87f05a94b1916674fb00d4cf4da0ed3ae9d9491ebd706afbb01e2a83332f4a4e
Seeding hyperdrive

The line containing the address appears to be output via stderr, not stdout, so currently some juggling like this is required to read only the hyper://… address:

hyp create drive 2>&1 | grep -oE "hyper://\w+"

An -o/--only option (like grep) or -q/--quiet option (like many tools) that makes hyp output only the hyper://… url could be helpful.

@ghost
Copy link

ghost commented Apr 15, 2021

grep -oE "hyper://\w+"

depending on distro/version this is might not produce expected result,

grep -Eoe 'hyper://[0-9a-z]+' is more universal solution

@ghost
Copy link

ghost commented Apr 16, 2021

i can see the value for --only, but would --quiet option be usable in any way within context of the cli?

it will create new empty drive with unknown address and start seeding.. emptiness?
like, its a cute metaphor, but not very actionable

@Treora
Copy link
Contributor Author

Treora commented Apr 20, 2021

i can see the value for --only, but would --quiet option be usable in any way within context of the cli?

I suggested the two as alternative names for this option, not as two different options. Like with some other software, a single --quiet need not be completely silent (I’ve seen programs that hush all output if multiple -qs are passed).

@ghost
Copy link

ghost commented Apr 22, 2021

multiple -qs are passed

it's probably not entirely universal either:

$ docker ps -a -q
0169d163346e
$ docker ps -a
CONTAINER ID   IMAGE               COMMAND   CREATED          STATUS                    PORTS                                                                                                                                                                                                                 NAMES
0169d163346e   analogic/poste.io   "/init"   18 minutes ago   Up 18 minutes (healthy)   110/tcp, 143/tcp, 465/tcp, 0.0.0.0:25->25/tcp, :::25->25/tcp, 587/tcp, 995/tcp, 0.0.0.0:993->993/tcp, :::993->993/tcp, 4190/tcp, 0.0.0.0:12080->80/tcp, :::12080->80/tcp, 0.0.0.0:12443->443/tcp, :::12443->443/tcp   mailserver
$ docker ps -q
0169d163346e
$ docker ps -qq
0169d163346e
$ docker ps -q -q
0169d163346e
$ docker ps -qqq
0169d163346e
$ docker ps -q -q -q
0169d163346e

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

1 participant