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

update to 1.6.2 #39

Merged
merged 4 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
# ======================================================================================================================

# project
project(Modbus_TCP_client_shm LANGUAGES CXX VERSION 1.6.1)
project(Modbus_TCP_client_shm LANGUAGES CXX VERSION 1.6.2)

# settings
set(Target "modbus-tcp-client-shm") # Executable name (without file extension!)
Expand Down
52 changes: 0 additions & 52 deletions ClangFormat.cmake

This file was deleted.

59 changes: 0 additions & 59 deletions compileropts.cmake

This file was deleted.

52 changes: 0 additions & 52 deletions define.cmake

This file was deleted.

31 changes: 0 additions & 31 deletions modbus.cmake

This file was deleted.

23 changes: 9 additions & 14 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
//! Maximum number of registers per type
static constexpr size_t MODBUS_MAX_REGS = 0x10000;

//! Help output line width
static constexpr std::size_t HELP_WIDTH = 120;

//! Default permissions for the created shared memory
static constexpr mode_t DEFAULT_SHM_PERMISSIONS = 0660;

Expand Down Expand Up @@ -200,7 +197,15 @@ int main(int argc, char **argv) {

// print usage
if (args.count("help")) {
options.set_width(HELP_WIDTH);
static constexpr std::size_t MIN_HELP_SIZE = 80;
if (isatty(STDIN_FILENO)) {
struct winsize w {};
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1) { // NOLINT
options.set_width(std::max(static_cast<decltype(w.ws_col)>(MIN_HELP_SIZE), w.ws_col));
}
} else {
options.set_width(MIN_HELP_SIZE);
}
#ifdef OS_LINUX
if (isatty(STDIN_FILENO)) {
struct winsize w {};
Expand Down Expand Up @@ -230,16 +235,6 @@ int main(int argc, char **argv) {
}

// print version
if (args.count("longversion")) {
std::cout << PROJECT_NAME << ' ' << PROJECT_VERSION << " (compiled with " << COMPILER_INFO << " on "
<< SYSTEM_INFO << ')'
#ifndef OS_LINUX
<< "-nonlinux"
#endif
<< '\n';
return EX_OK;
}

if (args.count("shortversion")) {
std::cout << PROJECT_VERSION << '\n';
return EX_OK;
Expand Down
82 changes: 0 additions & 82 deletions warnings.cmake

This file was deleted.

Loading