Skip to content

List view organization #360

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

Closed
vsoch opened this issue May 27, 2021 · 3 comments
Closed

List view organization #360

vsoch opened this issue May 27, 2021 · 3 comments
Labels
enhancement New feature or request finished

Comments

@vsoch
Copy link
Member

vsoch commented May 27, 2021

Feedback:

  • Comment: the output of list is currently organised by tool, and then for each of these a comma-list of versions is given; I was wondering about an alternative output format that is easier to copy-paste or parse for use, e.g. listing one tool/version identifier per line

Yes this is a great idea! Could you provide an example here to get me started?

@vsoch vsoch added the enhancement New feature or request label May 27, 2021
@marcodelapierre
Copy link
Contributor

Sure, let me explain.

Here is an example of production use, with a few container modules installed:

$ shpc list
quay.io/biocontainers/bbmap: 38.90--he522d1c_1
marco/zio: v21
biocontainers/fastqc: v0.11.9_cv8, v0.11.5
biocontainers/samtools: v1.9-4-deb_cv1

Now, suppose I want to interact with one of these modules using the shpc commands. It can be any sub-command, let's take shpc inspect as an example.

Now, I am a lazy person and want to copy-paste the identifier of an installed module from the list above.
Right now I have to do it in two chunks, 1st copy-paste the module name, and 2nd copy-paste the version, because:

  1. there's always a space after the colon
  2. when there are multiple versions of a module, they're listed in a comma-separated way

Then, for this lazy copy-paste habit, I would find this output handier:

$ shpc list
quay.io/biocontainers/bbmap:38.90--he522d1c_1
marco/zio:v21
biocontainers/fastqc:v0.11.9_cv8
biocontainers/fastqc:v0.11.5
biocontainers/samtools:v1.9-4-deb_cv1

One disadvantage is that the list gets longer because you have one entry per version, rather than per tool.
Not sure whether this is a legitimate official use for the command, though :-D

Looking at the other open issues, one way to work around this would be enabling the autocompletion feature, so that one can tab-complete installed module identifiers (#363 ).

@vsoch
Copy link
Member Author

vsoch commented May 29, 2021

okay, here is an easier to read, and easier to copy paste solution! The default now shows all the containers and tags, one per line:

$ shpc list
        biocontainers/samtools:v1.9-4-deb_cv1
                        python:3.9.5-alpine
                        python:3.9.2-slim
                        python:3.9.2-alpine
                      dinosaur:fork
                 vanessa/salad:latest
                         salad:latest
      ghcr.io/autamus/prodigal:latest
      ghcr.io/autamus/samtools:latest
        ghcr.io/autamus/clingo:5.5.0

I added the left padding so the ":" would line up in the middle to make it easier to compare. If the user adds --short, then the original listing is shown:

$ shpc list --short
        biocontainers/samtools: v1.9-4-deb_cv1
                        python: 3.9.2-slim, 3.9.5-alpine, 3.9.2-alpine
                      dinosaur: fork
                 vanessa/salad: latest
                         salad: latest
      ghcr.io/autamus/prodigal: latest
      ghcr.io/autamus/samtools: latest
        ghcr.io/autamus/clingo: 5.5.0

That's probably the best of both worlds. This is also added to #367. And just in case it's not known, LMOD at least does support tab completion once you start typing the name!

@marcodelapierre
Copy link
Contributor

Looks great! thanks for thinking of the --short option, too

@vsoch vsoch added the finished label Jun 5, 2021
@vsoch vsoch closed this as completed Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request finished
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants