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

allow providing command as parameter — e.g.: up grep #11

Closed
pannous opened this issue Oct 24, 2018 · 3 comments
Closed

allow providing command as parameter — e.g.: up grep #11

pannous opened this issue Oct 24, 2018 · 3 comments
Labels
enhancement New feature or request 😎 good first issue Good for newcomers
Milestone

Comments

@pannous
Copy link

pannous commented Oct 24, 2018

please allow giving command to up as parameter (also to avoid the rm nightmare)

@akavel
Copy link
Owner

akavel commented Oct 24, 2018

Thanks for the idea! I'd like to actually do this indeed at some point in future.

@akavel akavel added the enhancement New feature or request label Oct 24, 2018
@akavel akavel added this to the later milestone Oct 24, 2018
@akavel akavel changed the title ./up grep allow providing command as parameter — e.g.: up grep Oct 24, 2018
@puffnfresh
Copy link

This would work for my ghci stuff.

@akavel
Copy link
Owner

akavel commented Oct 31, 2018

Note to self: because we now support various different shells (which have different standards for quoting), the full pipeline would have to be passed as a single argument (in quotes). For symmetry with a convention that seems popular among Linux tools, I think it would be a good idea then to pass it via a "-c" flag. Example call would then look like below:

$ lshw |& up -c "grep network -A2 | grep :"

edit: This flag could also be used to load commands from old upN.sh scripts, e.g. in bash:

$ lshw |& up -c "$( tail -n1 up1.sh )"

This could possibly be shortened to:

$ lshw |& up --command-from up1.sh

(+ internally: assert( len(lines) == 1 || (len(lines)==2 && lines[0].startsWith("#")) ) )


@puffnfresh Does the $SHELL discovery feature added in v0.3 work for you for ghci?

@akavel akavel added the 😎 good first issue Good for newcomers label Apr 12, 2020
@akavel akavel closed this as completed in 3a63622 Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 😎 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants