From c56dfc2607806c543419e0304560af1c85f05063 Mon Sep 17 00:00:00 2001 From: nick black Date: Wed, 9 Jun 2021 20:54:20 -0400 Subject: [PATCH] install caps-rendered as notcurses-info #1745 --- CMakeLists.txt | 16 +++++++++++ README.md | 3 +- doc/man/man1/notcurses-info.1.md | 35 ++++++++++++++++++++++++ src/{poc/caps-rendered.c => info/main.c} | 0 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 doc/man/man1/notcurses-info.1.md rename src/{poc/caps-rendered.c => info/main.c} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e541f8d3..255791972 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -548,6 +548,21 @@ target_link_libraries(notcurses-demo Threads::Threads ) +############################################################################ +# notcurses-info +file(GLOB INFOSRCS CONFIGURE_DEPENDS src/info/*.c) +add_executable(notcurses-info ${INFOSRCS}) +target_include_directories(notcurses-info + PRIVATE + include + "${CMAKE_REQUIRED_INCLUDES}" + "${PROJECT_BINARY_DIR}/include" +) +target_link_libraries(notcurses-info + PRIVATE + notcurses +) + ############################################################################ # notcurses-input file(GLOB INPUTSRCS CONFIGURE_DEPENDS src/input/input.cpp) @@ -786,6 +801,7 @@ list(FILTER MARKDOWN EXCLUDE REGEX "INSTALL.md") install(FILES ${MARKDOWN} DESTINATION ${CMAKE_INSTALL_DOCDIR}) install(TARGETS notcurses-demo DESTINATION bin) +install(TARGETS notcurses-info DESTINATION bin) install(TARGETS notcurses-input DESTINATION bin) install(TARGETS nctetris DESTINATION bin) install(TARGETS ncneofetch DESTINATION bin) diff --git a/README.md b/README.md index 8aac92d61..25caca7d5 100644 --- a/README.md +++ b/README.md @@ -123,12 +123,13 @@ may well be possible to use still older versions. Let me know of any successes! ## Included tools -Seven binaries are installed as part of Notcurses: +Eight binaries are installed as part of Notcurses: * `ncls`: an `ls` that displays multimedia in the terminal * `ncneofetch`: a [neofetch](https://github.com/dylanaraps/neofetch) ripoff * `ncplayer`: renders visual media (images/videos) * `nctetris`: a tetris clone * `notcurses-demo`: some demonstration code +* `notcurses-info`: detect and print terminal capabilities/diagnostics * `notcurses-input`: decode and print keypresses * `notcurses-tester`: unit testing diff --git a/doc/man/man1/notcurses-info.1.md b/doc/man/man1/notcurses-info.1.md new file mode 100644 index 000000000..dccd18759 --- /dev/null +++ b/doc/man/man1/notcurses-info.1.md @@ -0,0 +1,35 @@ +% notcurses-info(1) +% nick black +% v2.3.2 + +# NAME + +notcurses-info - Display information about the terminal environment + +# SYNOPSIS + +**notcurses-info** + +# DESCRIPTION + +**notcurses-info** prints all the information it knows about the current +terminal environment, including material loaded from **terminfo(5)** (based +on the **TERM** environment variable), replies from the terminal in +response to our queries, and built-in heuristics. + +The Unicode half block, quadrant, sextant, and Braille glyphs are all included +in the output. If their appearance is irregular, it might behoove you to choose +another font. + +# OPTIONS + +# NOTES + +The behavior of **notcurses-info** (and indeed all of Notcurses) depends on +the **TERM** and **LANG** environment variables, the installed POSIX locales, +and the installed **terminfo(5)** databases. + +# SEE ALSO + +**notcurses(3)**, +**terminfo(5)** diff --git a/src/poc/caps-rendered.c b/src/info/main.c similarity index 100% rename from src/poc/caps-rendered.c rename to src/info/main.c