feat: add info command line subcommand (#1330)

* feat: add `info` command line subcommand

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.

* fix: info command don't create runtime directory

* fix: don't print runtime path on Windows

Windows doesn't use the runtime path so it shouldn't be printed there.

* fix: make `info` command easier to parse

* docs: add back the default configuration directory
This commit is contained in:
Thomas Frans
2023-11-27 08:43:55 +01:00
committed by GitHub
parent 0c9be11357
commit 0cee99ba4c
10 changed files with 110 additions and 54 deletions

View File

@@ -5,6 +5,7 @@ use cursive::utils::markup::StyledString;
use cursive::view::ViewWrapper;
use cursive::views::{ScrollView, TextView};
use cursive::Cursive;
use ncspot::CONFIGURATION_FILE_NAME;
use crate::command::{Command, MoveAmount, MoveMode};
use crate::commands::CommandResult;
@@ -22,7 +23,9 @@ impl HelpView {
let note = format!(
"Custom bindings can be set in {} within the [keybindings] section.\n\n",
config_path("config.toml").to_str().unwrap_or_default()
config_path(CONFIGURATION_FILE_NAME)
.to_str()
.unwrap_or_default()
);
text.append(StyledString::styled(note, Effect::Italic));