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

feat: add info command line subcommand #1330

Merged
merged 6 commits into from
Nov 27, 2023

Conversation

ThomasFrans
Copy link
Contributor

@ThomasFrans ThomasFrans commented Nov 9, 2023

Adding an info command allows the documentation to refer to it when mentioning platform specific information. This gives users a nicer experience since they don't need to think about how ncspot will behave on their system, but can run ncspot info to get that information.

closes #1325

Adding an info command allows the documentation to refer to it when
mentioning platform specific information. This gives users a nicer
experience since they don't need to think about how `ncspot` will behave
on their system, but can run `ncspot info` to get that information.
@ThomasFrans
Copy link
Contributor Author

ThomasFrans commented Nov 9, 2023

Describe your changes

  • Add the info subcommand which prints platform-specific information
  • Update the config module with new functions to get the path to configuration and cache directories without creating them
  • Remove the proj_dirs() function from the config module in favor of these new functions
  • Add a constant for the configuration file name
  • Update the documentation to refer to this command
  • Update the changelog

info command behavior

Issue ticket number and link

#1325

Checklist before requesting a review

  • Documentation was updated (i.e. due to changes in keybindings, commands, etc.)
  • Changelog was updated with relevant user-facing changes (eg. not dependency updates,
    not performance improvements, etc.)

@ThomasFrans
Copy link
Contributor Author

I don't know how PRs are merged but I just now thought that maybe the PR message was used as commit message. That's why I moved the template stuff in its own comment, as that's not part of the commit message probably... I'm not sure how commit messages are created from a PR though (I know it's a setting per repo).

Windows doesn't use the runtime path so it shouldn't be printed there.
@ThomasFrans
Copy link
Contributor Author

With that I think it should be finished. It's rather simple, but I wanted to keep the output easy to parse if anyone wants/needs that.

@ThomasFrans ThomasFrans marked this pull request as ready for review November 9, 2023 21:28
@ThomasFrans ThomasFrans marked this pull request as draft November 9, 2023 21:32
@ThomasFrans
Copy link
Contributor Author

Quickly changed the printed format to 'NAME_OF_KEY VALUE_OF_KEY' so it can be parsed with something like cut -d' ' -f2 if needed.

info command output

@ThomasFrans ThomasFrans marked this pull request as ready for review November 9, 2023 21:39
Copy link
Owner

@hrkfdn hrkfdn left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me! And sorry for the delay, don't have a lot of time at the moment.

README.md Outdated Show resolved Hide resolved
@ThomasFrans
Copy link
Contributor Author

Thanks, looks good to me! And sorry for the delay, don't have a lot of time at the moment.

No problem. If you ever need help with managing issues or PRs (like reviewing PRs or sorting/organizing issues) I could always try to help.

@hrkfdn hrkfdn merged commit 0cee99b into hrkfdn:main Nov 27, 2023
5 checks passed
@hrkfdn
Copy link
Owner

hrkfdn commented Nov 27, 2023

Thanks again, let's get it in! :)

@ThomasFrans ThomasFrans deleted the add-platform-info-command branch November 27, 2023 08:20
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

Successfully merging this pull request may close these issues.

Add CLI command printing user paths
2 participants