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

Options for ckan show to hide sections #3461

Merged

Conversation

HebaruSan
Copy link
Member

Motivation

ckan show uses a fairly lengthy hard-coded output format. Some users may wish to only see some parts of it, for example if they're processing the output with other tools.

Changes

Now ckan show has several new options for hiding sections (--with-versions was already there but lacked help text, which is now added):

$ ckan show --help
CKAN 1.30.5+d398f2e236d6
Copyright © 2014-2020

show - Show information about a mod
Usage: ckan show [options] module

  --without-description      Don't show the name, abstract, or description

  --without-module-info      Don't show the version, authors, status license,
                             tags, languages

  --without-relationships    Don't show dependencies or conflicts

  --without-resources        Don't show home page, etc.

  --without-files            Don't show contained files

  --with-versions            Print table of all versions of the mod and their
                             compatible game versions

For example, you can print just the resources like this:

$ _build/ckan.exe show Astrogator --without-files --without-relationships --without-module-info --without-description

Resources:
  Home page:    https://forum.kerbalspaceprogram.com/index.php?/topic/155998-*
  Repository:   https://github.com/HebaruSan/Astrogator
  Bug tracker:  https://github.com/HebaruSan/Astrogator/issues
  Version file: https://raw.githubusercontent.com/HebaruSan/Astrogator/master/Astrogator.version

Fixes #1560.

@HebaruSan HebaruSan added Enhancement Easy This is easy to fix Cmdline Issues affecting the command line labels Oct 11, 2021
@HebaruSan HebaruSan force-pushed the feature/cmdline-show-without-sections branch from ec9a7f5 to 77f7732 Compare October 11, 2021 20:18
Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like it should, nice to have 👍

@HebaruSan HebaruSan merged commit 988a39e into KSP-CKAN:master Nov 1, 2021
@HebaruSan HebaruSan deleted the feature/cmdline-show-without-sections branch November 1, 2021 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cmdline Issues affecting the command line Easy This is easy to fix Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ‘subsection’ options for show in CLI
2 participants